-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.json
132 lines (132 loc) · 3.47 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{
"env": {
"browser": true
},
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"typescript": {}
}
},
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"next/core-web-vitals"
],
"plugins": ["react", "prettier", "eslint-plugin-prettier"],
"rules": {
"@typescript-eslint/no-unused-vars": "error",
"import/no-unresolved": [
"error",
{
"commonjs": true,
"amd": true
}
],
"react/jsx-curly-brace-presence": ["error", "never"],
"import/named": 2,
"import/namespace": 2,
"import/default": 2,
"import/export": 2,
"import/newline-after-import": [
"error",
{
"count": 1
}
],
"import/order": [
"error",
{
// Always insert nl between groups
"newlines-between": "always",
"alphabetize": {
"order": "asc" /* sort in ascending order */,
"caseInsensitive": true /* ignore case */
},
// We want to import react before the other externals
"pathGroups": [
{
"pattern": "react",
"group": "external",
"position": "before"
}
],
"pathGroupsExcludedImportTypes": ["internal"],
"groups": [
// Built-in modules first (fs, path, etc)
"builtin",
// Externals are next (react, redux, etc)
"external",
// Internals are next (@/**/*, etc)
"internal",
// Parent directories imports are the next (../**/*)
"parent",
// Same directory imports are the next (./foo)
"sibling",
// And the index is the final one ('./')
"index"
]
}
],
"padding-line-between-statements": [
2,
// Always require blank lines after import, except between imports
{
"blankLine": "always",
"prev": "import",
"next": "*"
},
{
"blankLine": "any",
"prev": "import",
"next": "import"
},
// Always require blank lines before and after every sequence of variable declarations and export
{
"blankLine": "always",
"prev": "*",
"next": ["const", "let", "var", "export"]
},
{
"blankLine": "always",
"prev": ["const", "let", "var", "export"],
"next": "*"
},
{
"blankLine": "any",
"prev": ["const", "let", "var", "export"],
"next": ["const", "let", "var", "export"]
},
// Always require blank lines before and after class declaration, if, do/while, switch, try
{
"blankLine": "always",
"prev": "*",
"next": ["if", "class", "export", "for", "do", "while", "switch", "try"]
},
{
"blankLine": "always",
"prev": ["if", "class", "for", "do", "while", "switch", "try"],
"next": "*"
},
// Always require blank lines before return statements
{
"blankLine": "always",
"prev": "*",
"next": "return"
}
],
// we want to avoid extraneous spaces
"no-multi-spaces": ["error"],
// we want to avoid trailing spaces
"no-trailing-spaces": ["error"],
"prettier/prettier": "error"
}
}