-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
116 lines (116 loc) · 2.71 KB
/
.eslintrc.json
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
116
{
"root": true,
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": [
"./tsconfig.json",
"./packages/**/tsconfig.json",
"./examples/**/tsconfig.json"
]
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".ts"]
}
}
},
"ignorePatterns": [
"node_modules/",
"submodules/",
"dist/",
"*.js",
"*.jsx",
"vitest.config.ts"
],
"plugins": ["@typescript-eslint", "import", "unused-imports", "prettier"],
"rules": {
"object-shorthand": ["error", "always"],
"import/prefer-default-export": "off",
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
],
"import/order": [
"error",
{
"groups": [
"builtin", // Node.js builtins
"external", // All npm modules
"internal", // Alias for src or other internal paths
["sibling", "parent"], // Relative imports
"index", // import from index files
"object" // object imports (e.g., `import('./foo')`)
],
"pathGroups": [
{
"pattern": "react",
"group": "external",
"position": "before"
},
{
"pattern": "react-*",
"group": "external",
"position": "before"
}
],
"pathGroupsExcludedImportTypes": ["react"],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"import/no-unresolved": "error",
"import/newline-after-import": "error",
"import/no-cycle": [
2,
{
"maxDepth": 4
}
],
"unused-imports/no-unused-imports": "error",
"no-redeclare": "error",
"no-continue": "off",
"no-extra-boolean-cast": "off",
"no-use-before-define": "off",
"no-await-in-loop": "error",
"no-return-await": "error",
"no-restricted-syntax": ["error", "ForInStatement"],
"no-console": [
"error",
{
"allow": ["error", "log"]
}
],
"max-classes-per-file": ["error", 2],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/ban-ts-comment": "off"
},
"overrides": [
{
"files": ["**/*.spec.ts"],
"rules": {
"import/no-extraneous-dependencies": "off"
}
}
]
}