-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
62 lines (62 loc) · 2.26 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
module.exports = {
parser: "@typescript-eslint/parser", //handle typescript
parserOptions: {
ecmaVersion: 2020, // Use the latest ecmascript standard
sourceType: "module", // Allows using import/export statements
ecmaFeatures: {
jsx: true // Enable JSX
}
},
settings: {
react: {
version: "detect" // Automatically detect the react version
},
"import/resolver": {
"node": true,
"eslint-import-resolver-typescript": true
}
},
env: {
browser: true, // Enables browser globals like window and document
amd: true, // Enables require() and define() as global variables as per the amd spec.
node: true, // Enables Node.js global variables and Node.js scoping.
es6: true
},
plugins: ["@typescript-eslint", "react", "react-hooks"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
],
rules: {
"react/react-in-jsx-scope": "off",
"jsx-a11y/anchor-is-valid": [
"error",
{
components: ["Link"],
specialLink: ["hrefLeft", "hrefRight"],
aspects: ["invalidHref", "preferButton"]
}
],
"@typescript-eslint/explicit-function-return-type": ["off"],
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-unused-vars": ["error", {
"vars": "all",
"args": "after-used",
"argsIgnorePattern": "^_"
}],
"react/prop-types": "off",
"indent": ["warn", 4, {"SwitchCase": 1}],
"semi": ["warn", "always"],
"quotes": ["warn", "double", "avoid-escape"],
"max-len": ["warn", 120, 4],
"import/extensions": [0, "never", {"ts": "never"}],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
}
};