-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.js
91 lines (89 loc) · 2.24 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
module.exports = {
// javascript
env: { browser: true, es6: true, node: true },
extends: [
'eslint:recommended',
'plugin:jsx-a11y/recommended',
'plugin:react-hooks/recommended',
'airbnb',
'plugin:prettier/recommended',
'prettier/react',
],
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: { jsx: true },
ecmaVersion: 2020,
sourceType: 'module',
},
plugins: ['react'],
rules: {
'react/react-in-jsx-scope': 0,
'react/jsx-filename-extension': 0,
'no-console': 'warn',
'no-debugger': 'warn',
'no-irregular-whitespace': 'warn',
camelcase: 'warn',
'comma-spacing': 'error',
'arrow-spacing': 'error',
'prefer-const': 'error',
'prefer-destructuring': 'error',
'import/no-extraneous-dependencies': 0,
'jsx-a11y/anchor-is-valid': 0,
'jsx-a11y/label-has-associated-control': [
'error',
{
required: {
some: ['nesting', 'id'],
},
},
],
},
settings: { react: { version: 'detect' } },
// typescript-related configs overrides
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
ecmaFeatures: { jsx: true },
},
extends: [
'plugin:@typescript-eslint/all',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
],
rules: {
'react/prop-types': 0,
'@typescript-eslint/no-magic-numbers': 0,
'import/prefer-default-export': 0,
'@typescript-eslint/prefer-readonly-parameter-types': 0,
'@typescript-eslint/default-param-last': 0,
'@typescript-eslint/strict-boolean-expressions': 0,
'react/jsx-props-no-spreading': 0,
'@typescript-eslint/naming-convention': [
'warn',
{
selector: 'function',
format: ['PascalCase'],
},
],
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
},
settings: {
'import/resolver': {
typescript: {},
},
},
},
],
};