-
Notifications
You must be signed in to change notification settings - Fork 26
/
.eslintrc.js
85 lines (82 loc) · 2.27 KB
/
.eslintrc.js
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
81
82
83
84
85
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
ignorePatterns: ["node_modules", ".eslintrc.js", "next.config.js"],
plugins: ["@typescript-eslint", "import"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@next/next/recommended",
"plugin:@typescript-eslint/strict-type-checked",
],
settings: {
"import/resolver": {
typescript: true,
},
},
rules: {
// Possible Problems
"array-callback-return": "error",
"no-await-in-loop": "error",
"no-constructor-return": "error",
"no-promise-executor-return": "error",
"no-self-compare": "error",
"no-template-curly-in-string": "error",
"no-unmodified-loop-condition": "error",
"no-unreachable-loop": "error",
"no-unused-private-class-members": "error",
"no-use-before-define": "error",
"require-atomic-updates": "error",
// Suggestions
camelcase: "error",
"capitalized-comments": ["error", "always"],
curly: ["error", "multi-line"],
eqeqeq: "error",
"no-console": "error",
"no-invalid-this": "error",
"prefer-const": [
"error",
{
ignoreReadBeforeAssign: true,
},
],
// Layout & Formatting
"array-bracket-newline": ["error", { multiline: true }],
indent: ["error", 2, { SwitchCase: 1 }],
quotes: ["error", "double"],
semi: ["error", "always"],
"brace-style": "error",
"comma-dangle": ["error", "always-multiline"],
"no-trailing-spaces": "error",
"eol-last": "error",
// Imports
"import/first": "error",
"import/newline-after-import": "error",
"no-duplicate-imports": ["error", { includeExports: true }],
"import/order": [
"error",
{
groups: [
"builtin",
"external",
["internal", "parent", "sibling", "index"],
],
"newlines-between": "always",
distinctGroup: false,
alphabetize: { order: "asc" },
pathGroups: [
{
pattern: "@/app/**",
group: "internal",
position: "before",
},
],
},
],
},
};