-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
92 lines (92 loc) · 2.47 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
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['prettier', '@typescript-eslint', 'react-hooks'],
extends: [
'airbnb',
'airbnb/hooks',
'prettier',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:@next/next/recommended',
],
rules: {
semi: ['error', 'always'],
'prettier/prettier': 0,
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'**/*.stories.tsx',
'**/*.@(spec|test).@(js|ts)?(x)',
'**/testUtils.tsx',
'**/jest.setup.ts',
'**/.storybook/*.@(js|ts)?(x)',
'**/webpack.*.js',
'**/script/*.js',
'**/mocks/**/*.@(js|ts)?(x)',
],
},
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/react-in-jsx-scope': 'off',
'react/jsx-props-no-spreading': 'off',
'react/no-unknown-property': ['error', { ignore: ['css'] }],
'react/jsx-filename-extension': ['error', { extensions: ['.tsx', '.jsx', 'spec.js'] }],
'react/function-component-definition': 'off',
'react/no-unescaped-entities': 'off',
'@next/next/no-page-custom-font': 'off',
'import/no-duplicates': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
mjs: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'import/no-unresolved': [2, { ignore: ['\\.img$'] }],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling'],
pathGroups: [
{
pattern: 'react',
group: 'external',
position: 'before',
},
{
pattern: '[@]common/**',
group: 'external',
position: 'after',
},
],
pathGroupsExcludedImportTypes: ['react'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'jsx-a11y/label-has-associated-control': ['error', { controlComponents: ['input', 'select'] }],
'no-param-reassign': 'off',
},
settings: {
// 'import/resolver': {
// node: {
// extensions: ['.js', '.jsx', '.ts', '.tsx'],
// },
// },
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {},
},
},
};