-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
73 lines (60 loc) · 1.82 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
70
71
72
73
{
"extends": [
"next/core-web-vitals",
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended"
],
"plugins": [
"react",
"react-hooks"
],
"env": {
"browser": true,
"jest": true,
"es2021": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 2021,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
// Enforce consistent semicolon usage
"semi": ["error", "always"],
// Enforce the use of single quotes for strings
"quotes": ["error", "single"],
// Enforce consistent indentation (2 spaces)
"indent": ["error", 2],
// Enforce consistent line breaks between functions and variables
"newline-before-return": "error",
// Enforce the consistent use of curly braces for all control statements
"curly": ["error", "all"],
// Enforce no unused variables
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
// Enforce that all variables are declared using `const` or `let`
"no-var": "error",
// Disallow unnecessary `else` statements after return
"no-else-return": "error",
// Enforce the use of `===` and `!==` for comparisons
"eqeqeq": "error",
// Ensure that every `useEffect` hook has a dependency array
"react-hooks/exhaustive-deps": "warn",
// Disallow `console.log` and other debugging tools in production code
"no-console": ["warn", { "allow": ["warn", "error"] }],
// React specific: enforce consistent naming of components
"react/jsx-pascal-case": "error",
// React specific: prevent direct mutation of state
"react/no-direct-mutation-state": "error",
// Enforce no extra spaces inside of arrays or objects
"no-multi-spaces": "error"
},
"settings": {
"react": {
"version": "detect"
}
}
}