-
Notifications
You must be signed in to change notification settings - Fork 8
/
.eslintrc.js
110 lines (110 loc) · 2.57 KB
/
.eslintrc.js
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
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
jest: true
},
settings: {
react: {
version: "detect"
},
"import/resolver" : {
typescript: {}
}
},
ignorePatterns: ['build/**'],
parser: "@babel/eslint-parser",
parserOptions: {
requireConfigFile: false,
ecmaVersion: "latest",
sourceType: "module",
ecmaFeatures: {
jsx: true
}
},
plugins: [
"react",
"react-hooks",
"prettier",
"simple-import-sort",
],
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"react-app",
"react-app/jest",
"prettier",
],
rules: {
"react/function-component-definition": 0,
"react/boolean-prop-naming": 0,
"react/prop-types": 0,
"react-hooks/exhaustive-deps": 1,
"react/react-in-jsx-scope": 0,
"no-multi-spaces": 1,
"no-unused-vars": 1,
"react/display-name": [0],
"react-hooks/rules-of-hooks": "error",
"no-restricted-imports": [
"error",
{
"patterns": ["@mui/*/*/*", "!@mui/material/test-utils/*"]
}
],
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error"
},
overrides: [
{
files: ["**/*.{js}"],
rules: {
"quotes": ["error", "single"],
}
}, {
files: ["**/*.{ts,tsx}"],
globals: {
React: "writable"
},
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
typescript: {
project: "./tsconfig.json"
}
}
},
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
project: "./tsconfig.json"
},
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:react/jsx-runtime",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"react-app",
"react-app/jest",
],
rules: {
"jsx-quotes": ["error", "prefer-double"],
"quotes": ["error", "single"],
"react/react-in-jsx-scope": "off",
"react/jsx-filename-extension": "off",
"react/jsx-closing-tag-location": "error",
"react/jsx-pascal-case": "error",
"react/self-closing-comp": "error",
"react/jsx-wrap-multilines": "error",
"react/prop-types": "off",
}
}
]
}