-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
101 lines (96 loc) · 3.3 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
module.exports = {
env: {
browser: true,
es6: true,
jest: true,
},
extends: ['plugin:react/recommended', 'airbnb', 'plugin:prettier/recommended'],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
React: 'writable',
JSX: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['react', '@typescript-eslint', 'react-hooks'],
rules: {
indent: 'off',
radix: 'warn',
camelcase: 'off',
'no-console': 'off',
'no-plusplus': 'off',
'no-continue': 'off',
'no-redeclare': 'off',
'no-unused-vars': 'off',
'no-multi-assign': 'off',
'no-await-in-loop': 'off',
'no-param-reassign': 'off',
'consistent-return': 'off',
'spaced-comment': ['error', 'always', { markers: ['/'] }],
'prefer-destructuring': 'off',
'no-restricted-syntax': 'off',
'no-underscore-dangle': 'off',
'max-classes-per-file': 'off',
'no-use-before-define': 'off',
'class-methods-use-this': 'off',
'import/extensions': 'off',
'import/no-default-export': 'error',
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': ['error', { optionalDependencies: true }],
'react/prop-types': 'off',
'react/button-has-type': 'off',
'react/no-array-index-key': 'off',
'react/no-unescaped-entities': 'warn',
'react/require-default-props': 'off',
'react/jsx-props-no-spreading': 'off',
'react/jsx-no-useless-fragment': 'off',
'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
'react/destructuring-assignment': 'off',
'react/static-property-placement': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/function-component-definition': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': ['error'],
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/label-has-associated-control': [
'error',
{ required: { some: ['nesting', 'id'] }, controlComponents: ['Textarea'] },
],
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
},
settings: {
'import/resolver': { node: { extensions: ['.ts', '.js', '.tsx', '.jsx'] } },
},
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/no-unused-vars': [2, { args: 'none' }],
},
},
{
files: ['**/*.stories.*'],
rules: {
'import/no-anonymous-default-export': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-default-export': 'off',
},
},
{
files: ['**/*.stories.*'],
rules: {
'import/no-anonymous-default-export': 'off',
},
},
],
}