-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathxo.config.mjs
More file actions
115 lines (105 loc) · 2.98 KB
/
Copy pathxo.config.mjs
File metadata and controls
115 lines (105 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import globals from "globals";
import jsxA11y from "eslint-plugin-jsx-a11y";
import perfectionist from "eslint-plugin-perfectionist";
import reactRefresh from "eslint-plugin-react-refresh";
import tailwindcss from "eslint-plugin-tailwindcss";
import unusedImports from "eslint-plugin-unused-imports";
/** @type import('xo').FlatXoConfig */
const xoConfig = [
{
files: ["**/*.js", "**/*.cjs", "**/*.mjs", "**/*.mts", "**/*.ts", "**/*.tsx"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
projectService: {
allowDefaultProject: ["*.cjs", "*.mjs"],
defaultProject: "./tsconfig.json",
},
sourceType: "module",
tsconfigRootDir: import.meta.dirname,
},
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
plugins: {
perfectionist,
"react-refresh": reactRefresh,
tailwindcss,
"unused-imports": unusedImports,
},
prettier: true,
rules: {
"@stylistic/block-spacing": "off",
"@stylistic/indent-binary-ops": "off",
"@stylistic/jsx-sort-props": "error",
"@stylistic/member-delimiter-style": "off",
"@stylistic/no-mixed-operators": "off",
"@stylistic/object-curly-spacing": ["error", "always"],
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-dynamic-delete": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/triple-slash-reference": "off",
"import-x/extensions": "off",
"import-x/no-anonymous-default-export": "off",
"n/file-extension-in-import": "off",
"n/prefer-global/process": "off",
...perfectionist.configs["recommended-alphabetical"].rules,
"perfectionist/sort-imports": "off",
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
"tailwindcss/classnames-order": "error",
"tailwindcss/enforces-negative-arbitrary-values": "error",
"tailwindcss/enforces-shorthand": "error",
"tailwindcss/migration-from-tailwind-2": "error",
"tailwindcss/no-arbitrary-value": "off",
"tailwindcss/no-contradicting-classname": "error",
"tailwindcss/no-custom-classname": "error",
"tailwindcss/no-unnecessary-arbitrary-value": "error",
"unicorn/filename-case": "off",
"unicorn/prefer-module": "off",
"unicorn/prevent-abbreviations": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
args: "after-used",
argsIgnorePattern: "^_",
vars: "all",
varsIgnorePattern: "^_",
},
],
},
settings: {
react: {
version: "detect",
},
tailwindcss: {
config: `${import.meta.dirname}/src/index.css`,
},
},
},
{
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
"jsx-a11y": jsxA11y,
},
rules: {
...jsxA11y.configs.strict.rules,
},
},
{
rules: {
"comma-dangle": ["error", "only-multiline"],
},
},
];
export default xoConfig;