-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.cjs
106 lines (106 loc) · 2.53 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
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
module.exports = {
root: true,
env: {
browser: true,
node: true,
es2020: true,
},
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
node: {},
alias: {
map: [['@', './src']],
},
typescript: {},
},
},
rules: {
'no-console': 'off',
'import/no-unresolved': ['error', { commonjs: true, amd: true }],
'import/extensions': ['error', 'never', { packages: 'always' }],
'import/no-extraneous-dependencies': ['error'],
'jsx-a11y/label-has-for': [
'error',
{
// components: ["Label"],
required: {
some: ['nesting', 'id'],
},
allowChildren: true,
},
],
'jsx-a11y/label-has-associated-control': [
'error',
{
required: {
some: ['nesting', 'id'],
},
},
],
'jsx-a11y/click-events-have-key-events': ['off'],
'jsx-a11y/mouse-events-have-key-events': ['off'],
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link'],
specialLink: ['to', 'hrefLeft', 'hrefRight'],
aspects: ['invalidHref'],
},
],
'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
},
overrides: [
{
files: ['*.tsx', '*.ts'],
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
'plugin:import/typescript',
],
plugins: [
'@typescript-eslint',
'import',
'react',
'react-hooks',
'jsx-a11y',
'prettier',
],
parserOptions: {
project: './tsconfig.json',
createDefaultProgram: true,
},
settings: {
'import/resolver': {
typescript: {},
},
},
rules: {
'react/react-in-jsx-scope': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/prop-types': 'off',
},
},
{
files: ['(/__tests__/.*|(\\\\.|/)(test|spec))\\\\.[jt]sx?$'],
plugins: ['jest'],
extends: ['plugin:jest/recommended'],
rules: { 'jest/prefer-expect-assertions': 'off' },
},
],
};