-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
98 lines (94 loc) · 2.02 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
'use strict';
/* eslint-env node */
const eslintConfig = {
extends: 'eslint-config-egg',
env: {
browser: true,
es6: true,
node: true,
},
settings: {
'import/resolver': {
alias: {
map: [
[ '@', `${__dirname}/src` ],
],
extensions: [ '.ts', '.tsx', '.js', '.jsx', '.json' ],
},
},
},
parserOptions: {
ecmaVersion: 2020,
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
sourceType: 'module'
},
plugins: [
'import',
'react',
'react-hooks',
],
ignorePatterns: [ '*.d.ts' ],
rules: {
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
ts: 'never',
tsx: 'never',
js: 'never',
jsx: 'never',
},
],
},
overrides: [],
};
const tslintConfig = {
// enable the rule specifically for TypeScript files
files: [ '*.ts', '*.tsx' ],
extends: [
'eslint-config-egg/typescript',
'plugin:@typescript-eslint/recommended',
'eslint-config-airbnb'
],
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
],
settings: {
'import/parsers': {
'@typescript-eslint/parser': [ '.ts', '.tsx' ],
},
'import/resolver': {
...eslintConfig.settings['import/resolver'],
typescript: {
project: [
'tsconfig.json',
],
},
},
},
rules: {
...eslintConfig.rules,
'no-unused-vars': 'off',
'no-undef': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-var-requires': 'off',
strict: 'off',
'@typescript-eslint/ban-ts-comment': [ 'warn' ],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
"react/jsx-filename-extension": [
"error",
{
"extensions": [".tsx"]
}
]
},
};
eslintConfig.overrides.push(tslintConfig);
module.exports = eslintConfig;