-
-
Notifications
You must be signed in to change notification settings - Fork 131
/
.eslintrc.cjs
70 lines (69 loc) · 2.02 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['tree-shaking', 'prettier'],
extends: [
'airbnb',
'airbnb/hooks',
'prettier',
'plugin:markdown/recommended',
'plugin:storybook/recommended'
],
rules: {
'prettier/prettier': 'error',
},
overrides: [
{
files: ['*.ts', '*.tsx'],
excludedFiles: ['jest.config.ts', 'jest.setup.ts'],
extends: [
'airbnb',
'airbnb-typescript',
'airbnb/hooks',
'plugin:@typescript-eslint/recommended',
// @TODO Fix the problems when activating this config.
// 'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier',
],
parserOptions: {
project: ['./tsconfig.eslint.json'],
},
rules: {
'@typescript-eslint/no-use-before-define': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/no-confusing-void-expression': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/no-unused-vars': [
'warn',
{ ignoreRestSiblings: true, argsIgnorePattern: '^_' },
],
'sort-imports': ['error', { ignoreDeclarationSort: true }],
'react/function-component-definition': [
'error',
{
namedComponents: 'arrow-function',
unnamedComponents: 'function-expression',
},
],
'import/no-extraneous-dependencies': 'off',
'react/require-default-props': 'off',
'react/jsx-props-no-spreading': 'off',
'react/forbid-prop-types': 'off',
'react/default-props-match-prop-types': 'off',
},
},
{
files: ['*.ts', '*.tsx'],
excludedFiles: [
'jest.config.ts',
'jest.setup.ts',
'*.test.ts',
'*.test.tsx',
],
rules: {
'tree-shaking/no-side-effects-in-initialization': 'error',
},
},
],
};