-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy patheslint.config.mjs
More file actions
175 lines (167 loc) · 4.51 KB
/
Copy patheslint.config.mjs
File metadata and controls
175 lines (167 loc) · 4.51 KB
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
import { defineConfig, globalIgnores } from 'eslint/config';
import nextVitals from 'eslint-config-next/core-web-vitals';
import nextTs from 'eslint-config-next/typescript';
import importPlugin from 'eslint-plugin-import';
import prettierRecommended from 'eslint-plugin-prettier/recommended';
import reactPlugin from 'eslint-plugin-react';
export default defineConfig([
...nextVitals,
...nextTs,
prettierRecommended,
globalIgnores([
'.next/**',
// Build and tool output. Linting `.vercel` in particular took `eslint .` from 11s to over
// 55 minutes: it holds ~3.8MB of minified bundle chunks on single lines, which is worst-case
// input for the type-aware rules and for prettier.
'.vercel/**',
'coverage/**',
'out/**',
'build/**',
'next-env.d.ts',
'node_modules/**',
'public/**',
'storybook-static/**',
'cloud-functions/**',
]),
{
files: ['*.js', '*.mjs'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
{
plugins: {
import: importPlugin,
react: reactPlugin,
},
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'no-console': [
1,
{
allow: ['info', 'error'],
},
],
'react/jsx-props-no-spreading': [
'error',
{
html: 'ignore',
custom: 'ignore',
exceptions: [''],
},
],
'import/no-named-as-default': 0,
'import/order': [
'warn',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
pathGroups: [
{
pattern: 'react',
group: 'builtin',
position: 'before',
},
{
pattern: 'react**',
group: 'builtin',
},
{
pattern: '@react**',
group: 'builtin',
},
{
pattern: 'clsx',
group: 'builtin',
position: 'after',
},
{
pattern: 'lodash-es/**',
group: 'builtin',
position: 'after',
},
{
pattern: 'next/**',
group: 'builtin',
position: 'after',
},
{
pattern: 'node_modules/**',
group: 'builtin',
},
{
pattern: '@/lib/**',
group: 'external',
position: 'before',
},
{
pattern: '@/store/**',
group: 'external',
position: 'before',
},
{
pattern: 'hooks/**',
group: 'internal',
position: 'before',
},
{
pattern: '@/layouts/**',
group: 'internal',
position: 'before',
},
{
pattern: '@/containers/**',
group: 'internal',
position: 'before',
},
{
pattern: '@/components/**',
group: 'internal',
},
{
pattern: 'services/**',
group: 'internal',
position: 'after',
},
{
pattern: 'images/**',
group: 'internal',
position: 'after',
},
{
pattern: '@/svgs/**',
group: 'internal',
position: 'after',
},
],
pathGroupsExcludedImportTypes: ['react'],
},
],
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['lodash', '!lodash-es'],
message: 'Use lodash-es instead',
},
],
},
],
},
},
]);