-
Notifications
You must be signed in to change notification settings - Fork 7
/
.eslintrc.json
65 lines (62 loc) · 1.9 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
/*
Configure eslint for nextJs
Read more about it: https://dev.to/azadshukor/setting-up-nextjs-13-with-typescript-eslint-47an
Read about env : https://eslint.org/docs/latest/use/configure/language-options-deprecated#using-configuration-files
*/
{
"env": {
"browser": true,
"node": true,
"jest": true
},
"extends": [
"next/core-web-vitals",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:testing-library/react", // for jest unit testing
"plugin:jest-dom/recommended" // for jest unit testing
],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
// Note: you must disable the base rule as it can report incorrect errors
// instead we enabled -> @typescript-eslint/no-unused-vars
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"react/jsx-no-bind": [
"error",
{
"allowArrowFunctions": true,
"allowBind": false,
"ignoreRefs": true
}
],
"semi": "error",
"prefer-const": "error",
"no-console": "warn",
"react/no-did-update-set-state": "error",
"react/no-unknown-property": "error",
"react/no-unused-prop-types": "error",
"react/prop-types": "error",
"react/react-in-jsx-scope": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
// ES6 and Beyond
// "arrow-body-style": ["error", "as-needed"],
// "arrow-parens": ["error", "always"],
"no-var": "error",
"prefer-arrow-callback": "error",
// Code Readability and Consistency
"indent": ["error", 2],
// "quotes": ["error", "single", "backtick"],
// "camelcase": "error",
// Error Prevention
"no-undef": "error",
"eqeqeq": "error",
"no-implicit-coercion": "error",
"no-unused-expressions": "error",
"no-extra-boolean-cast": "error",
"no-eval": "error"
},
"root": true
}