-
Notifications
You must be signed in to change notification settings - Fork 85
/
.eslintrc.js
112 lines (112 loc) · 3.07 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
112
module.exports = {
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:react/jsx-runtime',
],
env: {
browser: true,
es6: true,
jest: true,
node: true,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
sourceType: 'module',
},
plugins: ['jest', 'jsx-a11y', 'react', 'react-hooks'],
settings: {
react: {
version: 'detect',
},
},
rules: {
'eol-last': 'warn',
indent: 'off',
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/valid-expect': 'error',
'jsx-a11y/label-has-for': [
'error',
{
required: {
some: ['nesting', 'id'],
},
allowChildren: true,
},
],
'no-use-before-define': 'off',
'no-unused-vars': ['warn', { ignoreRestSiblings: true }],
'no-undef': 'warn',
'no-useless-escape': 'warn',
'standard/computed-property-even-spacing': 'off',
'react/display-name': 'off',
'react/no-array-index-key': 'warn',
'react/no-danger': 'warn',
'react/no-find-dom-node': 'warn',
'react/no-multi-comp': 'off',
'react/prefer-es6-class': 'warn',
'react/prefer-stateless-function': 'warn',
'react/sort-comp': 'off',
'react/prop-types': [1, { ignore: ['className', 't'] }],
},
overrides: [
{
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
extends: ['plugin:testing-library/react'],
rules: {
'testing-library/prefer-screen-queries': 'warn',
'testing-library/no-node-access': 'off',
'testing-library/no-container': 'off',
'testing-library/render-result-naming-convention': 'warn',
},
},
{
files: ['./packages/**/*.{js,jsx,ts,tsx}'],
rules: {
'no-console': ['error', { allow: ['warn', 'error'] }],
},
},
{
files: ['*.jsx'],
rules: {
'jsx-quotes': 'off',
'react/forbid-prop-types': 'warn',
'react/jsx-closing-bracket-location': 'error',
'react/jsx-first-prop-new-line': ['error', 'multiline'],
'react/jsx-handler-names': 'error',
'react/jsx-key': 'warn',
'react/jsx-pascal-case': 'error',
'react/jsx-wrap-multilines': 'error',
'react/jsx-no-target-blank': 'warn',
},
},
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-var-requires': 'off',
'react/prop-types': 'warn',
},
},
{
files: ['*.stories.{jsx,tsx}'],
rules: {
'no-console': 'off',
'react/prop-types': 'off',
'react/no-array-index-key': 'off',
},
},
],
};