-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.js
101 lines (101 loc) · 2.18 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,
node: true,
},
extends: [
'plugin:react/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'airbnb',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
JSX: 'readonly',
RequestInit: 'readonly',
EventListener: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: [
'react',
'@typescript-eslint',
],
settings: {
'import/resolver': {
webpack: {
config: 'config/webpack/development.js',
},
},
react: {
version: 'detect',
},
},
rules: {
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'no-restricted-imports': [
'error',
{
patterns: ['../*'],
},
],
camelcase: [
'error',
{
allow: [
'\\$key$',
'\\$data$',
],
},
],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'jsx-a11y/control-has-associated-label': [
2,
{
ignoreElements: ['td', 'tr', 'th'],
},
],
'react/jsx-filename-extension': ['error', { extensions: ['.jsx', '.tsx'] }],
'react/prop-types': 'off',
'react/require-default-props': [1, { ignoreFunctionalComponents: true }],
'react/no-unused-prop-types': [0],
// note you must disable the base rule as it can report incorrect errors
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off',
// note you must disable the base rule as it can report incorrect errors
'no-shadow': 'off',
'@typescript-eslint/no-shadow': [
'error',
{
allow: ['_'],
},
],
'react/function-component-definition': [0],
'default-param-last': [0],
'react/no-unstable-nested-components': [0],
},
};