Skip to content

Commit 2f05208

Browse files
committed
Modernize ESLint configuration
1 parent 6c2353f commit 2f05208

File tree

2 files changed

+1425
-738
lines changed

2 files changed

+1425
-738
lines changed

.eslintrc.json

Lines changed: 53 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,63 @@
11
{
2-
"parser": "@typescript-eslint/parser",
2+
"env": {
3+
"browser": true,
4+
"node": true
5+
},
36
"extends": [
47
"eslint:recommended",
8+
"plugin:@typescript-eslint/eslint-recommended",
59
"plugin:import/recommended",
610
"plugin:react/recommended",
7-
"plugin:prettier/recommended"
8-
// "plugin:@typescript-eslint/recommended"
11+
"plugin:@typescript-eslint/recommended"
912
],
10-
"settings": {
11-
"react": {
12-
"version": "detect"
13-
},
14-
"import/ignore": [
15-
"react-native"
16-
],
17-
"import/resolver": {
18-
"node": {
19-
"extensions": [
20-
".js",
21-
".ts",
22-
".tsx"
23-
]
24-
}
25-
}
26-
},
13+
"parser": "@typescript-eslint/parser",
2714
"parserOptions": {
28-
"ecmaVersion": 6,
29-
"sourceType": "module",
30-
"ecmaFeatures": {
31-
"jsx": true,
32-
"experimentalObjectRestSpread": true
33-
}
34-
},
35-
"env": {
36-
"browser": true,
37-
"mocha": true,
38-
"node": true
15+
"ecmaFeatures": { "jsx": true },
16+
"ecmaVersion": 2015,
17+
"project": true,
18+
"sourceType": "module"
3919
},
20+
"plugins": ["@typescript-eslint", "import", "react"],
4021
"rules": {
41-
"valid-jsdoc": 2,
42-
"react/jsx-uses-react": 1,
43-
"react/jsx-no-undef": 2,
44-
"react/jsx-wrap-multilines": 2,
45-
"react/no-string-refs": 0,
46-
"no-unused-vars": "off",
47-
"@typescript-eslint/no-unused-vars": [
48-
"error"
49-
],
50-
"no-redeclare": "off",
51-
"@typescript-eslint/no-redeclare": [
52-
"error"
53-
],
54-
"@typescript-eslint/consistent-type-imports": [
55-
"error",
56-
{
57-
"prefer": "type-imports"
58-
}
59-
]
22+
"valid-jsdoc": [2]
6023
},
61-
"plugins": [
62-
"@typescript-eslint",
63-
"import",
64-
"react"
65-
],
66-
"globals": {
67-
"JSX": true
68-
}
69-
}
24+
"settings": {
25+
"import/ignore": ["react-native"],
26+
"import/resolver": { "node": { "extensions": [".js", ".ts", ".tsx"] } },
27+
"react": { "version": "detect" }
28+
},
29+
"overrides": [
30+
{
31+
"files": ["**/*.{ts,tsx,cts}"],
32+
"extends": [
33+
"eslint:recommended",
34+
"plugin:@typescript-eslint/eslint-recommended",
35+
"plugin:import/recommended",
36+
"plugin:react/recommended",
37+
"plugin:@typescript-eslint/recommended"
38+
],
39+
"rules": {
40+
"@typescript-eslint/ban-ts-comment": [0],
41+
"@typescript-eslint/no-redeclare": [2],
42+
"@typescript-eslint/no-explicit-any": [0],
43+
"@typescript-eslint/no-unused-vars": [0],
44+
"@typescript-eslint/ban-types": [0],
45+
"react/display-name": [0],
46+
"react/jsx-no-undef": [2],
47+
"react/jsx-uses-react": [1],
48+
"react/jsx-wrap-multilines": [2],
49+
"react/no-string-refs": [0],
50+
"@typescript-eslint/consistent-type-imports": [
51+
2,
52+
{ "fixStyle": "separate-type-imports" }
53+
],
54+
"@typescript-eslint/consistent-type-exports": [2],
55+
"valid-jsdoc": [2]
56+
}
57+
},
58+
{
59+
"files": ["**/test/**/*.{ts,tsx}"],
60+
"parserOptions": { "project": "./test/tsconfig.test.json" }
61+
}
62+
]
63+
}

0 commit comments

Comments
 (0)