-
Notifications
You must be signed in to change notification settings - Fork 6
/
.eslintrc.js
110 lines (104 loc) · 2.72 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
module.exports = /** @type {import('eslint').Linter.Config} */ ({
extends: [
'prettier',
'react-app',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:storybook/recommended',
'plugin:@typescript-eslint/recommended',
],
rules: {
'react/boolean-prop-naming': [
'error',
{
rule: '^is[A-Z]([A-Za-z0-9]?)+',
message: 'Boolean props should have `is` prefix',
},
],
'react/display-name': 'error',
'react/prop-types': 'warn',
'react/jsx-sort-props': [
'error',
{
callbacksLast: true,
shorthandFirst: true,
shorthandLast: false,
noSortAlphabetically: true,
reservedFirst: true,
},
],
'import/extensions': 0,
'import/no-unresolved': 0,
'import/no-anonymous-default-export': 0,
'import/no-extraneous-dependencies': 'error',
'import/no-unused-modules': 'error',
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'object',
'type',
],
'newlines-between': 'always',
},
],
'@typescript-eslint/ban-types': 'warn',
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'react-hooks/exhaustive-deps': 'warn',
'prefer-const': 0,
'comma-dangle': 0,
'no-console': 0,
'arrow-parens': 0,
'no-prototype-builtins': 0,
'class-methods-use-this': 0,
'no-param-reassign': 0,
'no-mixed-operators': 0,
'no-else-return': 0,
'prefer-promise-reject-errors': 0,
},
overrides: [
{
files: ['./scripts/**/*.js', './scripts/**/*.mjs'],
rules: {
'@typescript-eslint/no-var-requires': 0,
},
},
{
files: ['*.stories.tsx', '**/storybook/**/*.tsx'],
rules: {
'react/function-component-definition': 0,
'react/boolean-prop-naming': 0,
'react/prop-types': 0,
'react/no-unescaped-entities': 0,
},
},
{
files: ['*.test.ts', '*.test.tsx'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'react/prop-types': 'off',
},
},
{
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'react/prop-types': 'off',
'react-hooks/exhaustive-deps': 'off',
'react/boolean-prop-naming': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
},
},
],
});