/
.eslintrc.json
64 lines (64 loc) · 2.53 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
{
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": 2020, // Allows for the parsing of modern ECMAScript features
"sourceType": "module", // Allows for the use of imports
"ecmaFeatures": {
"jsx": true // Allows for the parsing of JSX
},
"useJSXTextNode": true, // If this is false, the parser creates the AST of JSX texts as the legacy style
"requireConfigFile": false // If this is false, will allow babel-eslint to run on files that do not have a Babel configuration associated with them. This can be useful for linting files that are not transformed by Babel (such as tooling configuration files)
},
"plugins": ["react-hooks", "prettier"],
"extends": [
"eslint:recommended",
"plugin:react/recommended", // Uses the recommended rules from eslint-plugin-react
"plugin:jsx-a11y/recommended", // Uses the recommended rules from the eslint-plugin-jsx-a11y
"plugin:import/errors",
"plugin:import/warnings",
"plugin:react-hooks/recommended", // Uses the recommended rules from the eslint-plugin-react-hooks to make better hooks.
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
"env": {
"es6": true,
"browser": true,
"commonjs": true,
"jest": true,
"node": true
},
"settings": {
"react": {
"version": "detect" // Tells eslint-plugin-react to automatically detect the version of React which u install to use.
}
},
"rules": {
"react/prop-types": 0,
"react/react-in-jsx-scope": 0, // Can use JSX without import React
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/no-children-prop": "warn",
"jsx-a11y/anchor-is-valid": "off", // Have href attribute is 「 not 」 required on an anchor (<a>), so Link can use (<Link> will generates href attribute).
"jsx-a11y/click-events-have-key-events": "warn",
"jsx-a11y/no-static-element-interactions": "warn",
"jsx-a11y/no-onchange": "warn",
"no-console": "off",
"no-unused-vars": "warn",
"prettier/prettier": [
// Can replace @eslint-plugin-reactp rules. Ref : https://github.com/prettier/eslint-plugin-prettier#options
"error",
{
"singleQuote": true
},
{
"usePrettierrc": true
}
],
"import/no-unresolved": [
"error",
// Can use import form '@XXX'
{
"ignore": ["^@"]
}
]
}
}