-
Notifications
You must be signed in to change notification settings - Fork 0
/
nextjs.eslintrc.json
80 lines (75 loc) · 2.62 KB
/
nextjs.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
74
75
76
77
78
79
80
{
// You may need to change this from a string into an array.
"extends": [
// Add these:
"eslint:recommended",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:import/recommended",
"plugin:import/typescript",
"prettier",
// Keep this one at the end.
// See docs: https://nextjs.org/docs/app/building-your-application/configuring/eslint#additional-configurations
"next/core-web-vitals"
],
// You might not need this.
"parserOptions": {
"project": true
},
"rules": {
// Add all of these:
// Uncomment this if you have verbatimModuleSyntax enabled and importing
// .ts files with a .js extension gives lint errors.
// "import/no-unresolved": "off",
// Uncomment these if you really need to.
// "@typescript-eslint/ban-ts-comment": "off",
// "@typescript-eslint/no-explicit-any": "off",
// "@typescript-eslint/no-non-null-assertion": "off",
// Avoid bugs.
"@typescript-eslint/no-shadow": ["error", { "ignoreTypeValueShadow": true }],
"@typescript-eslint/no-unsafe-unary-minus": "error",
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"@typescript-eslint/switch-exhaustiveness-check": "error",
"array-callback-return": "error",
"eqeqeq": "error",
"no-await-in-loop": "error",
"no-constant-binary-expression": "error",
"no-constructor-return": "error",
"no-constant-condition": [
"error",
{
"checkLoops": false
}
],
"no-promise-executor-return": "error",
"no-self-compare": "error",
"no-template-curly-in-string": "error",
// Stylistic.
"@typescript-eslint/consistent-type-definitions": ["warn", "type"],
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/prefer-regexp-exec": "warn",
"object-shorthand": ["warn", "properties"],
"sort-imports": ["warn", { "ignoreDeclarationSort": true }],
"import/consistent-type-specifier-style": ["warn", "prefer-top-level"],
"import/order": [
"warn",
{
"alphabetize": { "order": "asc" },
"groups": ["builtin", "external", "parent", "sibling", "index", "object", "type"],
"newlines-between": "always"
}
],
// Disabled because of too many false positives.
"@typescript-eslint/no-unnecessary-condition": "off",
"react-hooks/exhaustive-deps": "off"
}
}