-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
104 lines (96 loc) · 2.51 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
{
"root": true,
"env": { "browser": true, "es2020": true },
"extends": [
// By extending from a plugin config, we can get recommended rules without having to add them manually.
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:jsx-a11y/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:promise/recommended",
"plugin:testing-library/react",
"plugin:vitest/recommended",
// This disables the formatting rules in ESLint that Prettier is going to be responsible for handling.
// Make sure it's always the last config, so it gets the chance to override other configs.
"plugin:prettier/recommended"
],
"ignorePatterns": ["dist"],
"parser": "@typescript-eslint/parser",
"plugins": ["react-refresh"],
"settings": {
"react": {
// Tells eslint-plugin-react to automatically detect the version of React to use.
"version": "detect"
},
// Tells eslint how to resolve imports
"import/resolver": {
"typescript": true,
"node": {
"paths": ["src"],
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
},
"rules": {
// Add your own rules here to override ones from the extended configs.
// Enforce prefixing interfaces with "I".
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "interface",
"format": ["PascalCase"],
"custom": {
"regex": "^I[A-Z]",
"match": true
}
}
],
"@typescript-eslint/no-empty-interface": [
"error",
{
// Allow interfaces that only use Pick<> or Omit<>, for example.
"allowSingleExtends": true
}
],
// Doesn't work correctly with deeply nested exports, like FormikHelpers.
"import/named": "off",
// Named exports are preferred.
"import/no-default-export": "error",
// Enforce import grouping and ordering.
"import/order": [
"error",
{
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
"object"
],
"newlines-between": "always",
"alphabetize": { "order": "asc", "caseInsensitive": true }
}
],
"no-restricted-imports": [
"error",
{
"patterns": ["@/features/*/*"]
}
],
// Doesn't work correctly with some react-three-fiber properties.
"react/no-unknown-property": [
"error",
{ "ignore": ["args", "attach", "decay", "intensity", "position"] }
],
"react-refresh/only-export-components": [
"error",
{ "allowConstantExport": true }
]
}
}