-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
238 lines (233 loc) · 7.12 KB
/
.eslintrc.cjs
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
const path = require('path');
module.exports = {
env: {
browser: true,
node: true,
'jest/globals': true,
},
extends: [
'airbnb',
'airbnb/hooks',
'plugin:react/recommended',
'plugin:prettier/recommended',
'eslint:recommended',
'plugin:import/typescript',
'plugin:import/recommended',
'plugin:storybook/recommended',
'plugin:jest/recommended',
],
plugins: ['@typescript-eslint', 'import', 'prettier', 'react', 'react-hooks', '@emotion', 'jest'],
settings: {
react: { version: 'detect' },
jest: {
version: 29,
},
},
rules: {
'prettier/prettier': 'error',
'jsx-a11y/label-has-associated-control': 'off',
'react/function-component-definition': [2, { namedComponents: 'arrow-function' }],
'react/require-default-props': 'off',
'react/jsx-props-no-spreading': 'off',
'react/react-in-jsx-scope': 'off',
'class-methods-use-this': 'off',
'consistent-return': 'off',
'no-console': 'off',
'no-plusplus': 'off',
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-else-return': 'off',
'no-new': 'off',
'no-alert': 'off',
'no-continue': 'off',
'no-nested-ternary': 'off',
'no-param-reassign': 'off',
'no-use-before-define': 'off',
'no-restricted-exports': 'off',
'no-underscore-dangle': 'off',
'max-classes-per-file': 'off',
'jest/no-export': 'off',
'import/extensions': 'off',
'import/no-unresolved': 'off',
'import/no-import-module-exports': 'off',
'import/prefer-default-export': 'off',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
'newlines-between': 'always',
pathGroups: [
{
pattern: 'react',
group: 'external',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['react'],
},
],
},
overrides: [
{
files: ['**/*.ts?(x)'],
parser: '@typescript-eslint/parser',
extends: [
'airbnb-typescript',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
parserOptions: {
project: ['./tsconfig.json', './packages/**/tsconfig.json'],
},
rules: {
'@typescript-eslint/indent': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-throw-literal': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/no-redeclare': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'import/no-extraneous-dependencies': 'off',
},
},
{
files: ['**/*.spec.ts?(x)', '**/*.test.ts?(x)'],
rules: {
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
},
},
{
files: ['packages/client-setting/**/*.ts?(x)', 'packages/client-setting/**/*.js?(x)'],
settings: {
'import/resolver': {
typescript: {
project: path.resolve(`${__dirname}/packages/client-setting/tsconfig.json`),
},
},
},
},
{
files: ['packages/client-tetris/**/*.ts?(x)', 'packages/client-tetris/**/*.js?(x)'],
settings: {
'import/resolver': {
typescript: {
project: path.resolve(`${__dirname}/packages/client-tetris/tsconfig.json`),
},
},
},
},
{
files: ['packages/client-todo-list/**/*.ts?(x)', 'packages/client-todo-list/**/*.js?(x)'],
settings: {
'import/resolver': {
typescript: {
project: path.resolve(`${__dirname}/packages/client-todo-list/tsconfig.json`),
},
},
},
},
{
files: ['packages/common-components/**/*.ts?(x)', 'packages/common-components/**/*.js?(x)'],
settings: {
'import/resolver': {
typescript: {
project: path.resolve(`${__dirname}/packages/common-components/tsconfig.json`),
},
},
},
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
},
},
{
files: ['packages/common-const/**/*.ts?(x)', 'packages/common-const/**/*.js?(x)'],
settings: {
'import/resolver': {
typescript: {
project: path.resolve(`${__dirname}/packages/common-const/tsconfig.json`),
},
},
},
},
{
files: ['packages/common-components/**/*.ts?(x)', 'packages/common-components/**/*.js?(x)'],
settings: {
'import/resolver': {
typescript: {
project: path.resolve(`${__dirname}/packages/common-components/tsconfig.json`),
},
},
},
},
{
files: ['packages/common-const/**/*.ts?(x)', 'packages/common-const/**/*.js?(x)'],
settings: {
'import/resolver': {
typescript: {
project: path.resolve(`${__dirname}/packages/common-const/tsconfig.json`),
},
},
},
},
{
files: ['packages/common-hooks/**/*.ts?(x)', 'packages/common-hooks/**/*.js?(x)'],
settings: {
'import/resolver': {
typescript: {
project: path.resolve(`${__dirname}/packages/common-hooks/tsconfig.json`),
},
},
},
},
// {
// files: ['packages/common-lib/**/*.ts?(x)', 'packages/common-lib/**/*.js?(x)'],
// settings: {
// 'import/resolver': {
// typescript: {
// project: path.resolve(`${__dirname}/packages/common-lib/tsconfig.json`),
// },
// },
// },
// },
{
files: ['packages/common-styles/**/*.ts?(x)', 'packages/common-styles/**/*.js?(x)'],
settings: {
'import/resolver': {
typescript: {
project: path.resolve(`${__dirname}/packages/common-styles/tsconfig.json`),
},
},
},
},
{
files: ['packages/common-types/**/*.ts?(x)', 'packages/common-types/**/*.js?(x)'],
settings: {
'import/resolver': {
typescript: {
project: path.resolve(`${__dirname}/packages/common-types/tsconfig.json`),
},
},
},
},
{
files: ['packages/common-utils/**/*.ts?(x)', 'packages/common-utils/**/*.js?(x)'],
settings: {
'import/resolver': {
typescript: {
project: path.resolve(`${__dirname}/packages/common-utils/tsconfig.json`),
},
},
},
},
],
};