-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.eslintrc.js
136 lines (136 loc) · 3.84 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
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
module.exports = {
extends: [
'next/core-web-vitals',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended',
],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.eslint.json'],
},
rules: {
// ! enabling @typescript-eslint/recommended-requiring-type-checking triggers a lot of errors
// ! as type-checking is more strict than usual. In order to fix those errors progressively,
// ! we have changed the configuration rules from error to warning for now to avoid crashing the deploy.
// ! This does not mean the below rules are meant to stay as if, the warning must be fixed until
// ! linter does not complain about a specific rule and can be safely removed from below.
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/restrict-template-expressions': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-misused-promises': 'warn',
'@typescript-eslint/require-await': 'warn',
// ---
'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' }],
},
],
},
};