-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc
135 lines (135 loc) · 3.48 KB
/
.eslintrc
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
133
134
135
{
"plugins": [
"@typescript-eslint",
"@stylistic/js",
"perfectionist",
"import",
"unused-imports",
"prefer-arrow-functions",
],
"extends": [
"next",
"next/core-web-vitals",
"plugin:react/jsx-runtime",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:perfectionist/recommended-natural",
],
"ignorePatterns": [
"**/node_modules",
"**/out",
"**/playwright-report",
"**/.next",
"**/test-results",
],
"rules": {
// Code style
"object-shorthand": "error",
"arrow-body-style": ["error", "as-needed"],
"prefer-arrow-functions/prefer-arrow-functions": "error",
"curly": ["error", "multi-or-nest", "consistent"],
"unused-imports/no-unused-vars": [
"error",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_",
},
],
// Comment style
"@stylistic/js/spaced-comment": ["error", "always"],
"capitalized-comments": "error",
"multiline-comment-style": ["error", "starred-block"],
"no-warning-comments": "warn",
// TypeScript
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-empty-function": "off",
// React
"react/self-closing-comp": "error",
"react/jsx-boolean-value": "error",
"react/jsx-curly-brace-presence": "error",
"react/jsx-no-useless-fragment": "error",
// Next
"@next/next/no-img-element": "off",
// Imports & exports
"unused-imports/no-unused-imports": "error",
"import/first": "error",
"import/no-duplicates": "error",
"import/newline-after-import": "error",
"import/no-default-export": "error",
"import/consistent-type-specifier-style": [
"error",
"prefer-inline",
],
"@typescript-eslint/consistent-type-imports": [
"error",
{ "prefer": "type-imports", "fixStyle": "inline-type-imports" },
],
"no-restricted-imports": [
"error",
{ "paths": [{ "name": "react", "importNames": ["default"] }] },
],
"perfectionist/sort-imports": [
"error",
{
"type": "natural",
"order": "asc",
"newlines-between": "always",
"groups": [
"side-effect",
"builtin",
"react",
"next",
["external", "external-type"],
["internal", "internal-type"],
["parent", "parent-type"],
["sibling", "sibling-type"],
"style",
"unknown",
],
"custom-groups": {
"value": {
"react": ["react", "react-dom"],
"next": ["next", "next/*"],
},
},
},
],
"perfectionist/sort-named-imports": [
"error",
{
"order": "asc",
"type": "natural",
"group-kind": "values-first",
},
],
"perfectionist/sort-named-exports": [
"error",
{
"order": "asc",
"type": "natural",
"group-kind": "values-first",
},
],
},
"overrides": [
{
"files": ["./pages/**/*.tsx", "**.config.[jt]s"],
"rules": { "import/no-default-export": "off" },
},
{
"files": ["**/*.d.ts"],
"rules": {
"spaced-comment": "off",
"multiline-comment-style": "off",
"capitalized-comments": "off",
},
},
{
"files": ["**/e2e/?(*.)+(test).[jt]s?(x)"],
"extends": ["plugin:playwright/recommended"],
},
],
}