-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.json
69 lines (69 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
65
66
67
68
69
{
"parser": "@typescript-eslint/parser", // Specifies the 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
}
},
"settings": {
"react": {
"version": "detect" // Tells eslint-plugin-react to automatically detect the version of React to use
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
"project": "."
}
}
},
"extends": [
"plugin:react/recommended", // Uses the recommended rules from @eslint-plugin-react
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from @typescript-eslint/eslint-plugin
"plugin:@typescript-eslint/eslint-recommended",
"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.
"plugin:import/recommended",
"plugin:import/typescript"
],
"ignorePatterns": ["lib/*", "node_modules/*"],
"rules": {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "error",
"react/react-in-jsx-scope": "off",
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react-hooks/rules-of-hooks": "error", // Check hooks rules
"react-hooks/exhaustive-deps": [
"error",
{
"additionalHooks":
"(useCompareCallback|useCompareMemo|useCompareEffect|useCompareLayoutEffect)"
}
],
"camelcase": "warn",
"class-methods-use-this": "off",
"no-alert": "error",
"no-confusing-arrow": "warn",
"no-console": "error",
"no-mixed-operators": "warn",
"no-param-reassign": "warn",
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",
"no-unused-expressions": "error",
"no-use-before-define": 0,
"object-curly-newline": "off",
"operator-linebreak": "off",
"prefer-destructuring": "warn",
"prefer-template": 2,
"react/display-name": [
2,
{
"ignoreTranspilerName": true
}
],
"import/no-cycle": [2, { "maxDepth": 1 }]
}
}