-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
84 lines (81 loc) · 2.54 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
module.exports = {
"env": {
"browser": true,
"es2021": true
},
"extends": [
"airbnb",
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module",
"project": './tsconfig.json'
},
"plugins": [
"react",
"react-hooks",
"@typescript-eslint"
],
"rules": {
'@typescript-eslint/no-non-null-assertion': "off",
"no-empty-function": 1,
"no-named-as-default": 0,
"no-unused-expressions": 0,
"import/no-cycle": [0, { ignoreExternal: true }],
"import/prefer-default-export": 0,
"react/jsx-uses-react": "off",
"react/no-array-index-key": 0,
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"semi": 0,
"comma-dangle": 0,
'react/jsx-filename-extension': [2, { 'extensions': ['.js', '.jsx', '.ts', '.tsx'] }],
"react/react-in-jsx-scope": "off",
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
],
},
"overrides": [
{
/**Disable no param assignment due to project usinng Immer library/Redux Toolkit */
"files": ["src/store/**/*"],
"rules": {
"no-param-reassign": 0
}
}
],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
},
"typescript": {
"alwaysTryTypes": true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
// use <root>/path/to/folder/tsconfig.json
"project": "./tsconfig.json",
}
}
}
}