-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
111 lines (111 loc) · 2.99 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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: ['@typescript-eslint', 'jsx-a11y', 'react', 'react-hooks', 'import'],
settings: {
react: {
pragma: 'createElement',
version: 'detect',
},
},
overrides: [
{
files: ['**/__stories__/**', '**/__tests__/**', '**/__mocks__/**', 'src/testUtil.tsx'],
},
],
rules: {
'@typescript-eslint/no-extraneous-class': 'warn',
'@typescript-eslint/no-this-alias': 'error',
'jsx-a11y/aria-proptypes': 'error',
'jsx-a11y/aria-props': 'error',
'jsx-a11y/role-has-required-aria-props': 'error',
'react/no-danger': 'error',
'react/no-direct-mutation-state': 'error',
'react/no-find-dom-node': 'error',
'react/no-unsafe': 'error',
'react/void-dom-elements-no-children': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
eqeqeq: 'error',
'dot-notation': 'error',
'no-var': 'error',
'no-constant-condition': 'error',
'no-console': [
'error',
{
allow: ['warn', 'error', 'info'],
},
],
'no-debugger': 'error',
'no-dupe-args': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-empty': 'error',
'no-restricted-globals': [
'error',
{
name: 'event',
message: `The 'event' reference here is global. You probably want to use a local parameter.`,
},
{
name: 'length',
message: `The 'length' reference here is global. You probably want to use a local parameter.`,
},
],
'no-restricted-imports': [
'error',
{
patterns: [
// importing from a js file is usually a mistake
'*.js',
],
},
],
'no-restricted-properties': [
'error',
{
property: 'trimStart',
message: `trimStart isn't supported on Edge 18 + FF 60 ESR. Use trimLeft instead.`,
},
{
property: 'trimEnd',
message: `trimEnd isn't supported on Edge 18 + FF 60 ESR. Use trimRight instead.`,
},
],
'no-restricted-syntax': ['error', 'WithStatement'],
'prefer-const': 'error',
'no-new-wrappers': 'error',
'no-array-constructor': 'error',
'no-new-object': 'error',
'spaced-comment': ['error', 'always'],
'import/order': [
'error',
{
warnOnUnassignedImports: true,
// ensure imported modules get checked (css files)
groups: [],
// ignoring the order for everything but the pathGroups below
pathGroups: [
{
pattern: '**/*.+(scss|css)',
group: 'unknown',
position: 'after',
},
{
pattern: '{.,..}/**/*.+(scss|css)',
group: 'unknown',
position: 'after',
},
],
},
],
'no-console': 0,
},
extends: ['plugin:storybook/recommended'],
};