-
Notifications
You must be signed in to change notification settings - Fork 11
/
.eslintrc.js
62 lines (54 loc) · 1.53 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
const path = require('path');
module.exports = {
env: {
browser: true,
es6: true,
jest: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 2018,
ecmaFeatures: {
jsx: true,
},
project: './tsconfig.test.json',
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.ts'],
},
},
'import/extensions': ['.js', '.ts'],
},
plugins: ['@typescript-eslint'],
extends: [
'airbnb-base',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/@typescript-eslint',
],
rules: {
// 对象声明都必须用解构: 关闭
'prefer-destructuring': 0,
// 禁止for of: 关闭
'no-restricted-syntax': 0,
// 禁止 主要是不加分号可能语法混乱, 这里都加分号直接关闭.
'no-plusplus': 0,
'no-restricted-globals': 0,
'no-useless-escape': 0,
'no-unused-expressions': [2, { allowShortCircuit: true, allowTernary: true }],
'no-param-reassign': 0,
// 每个函数需要明确的返回的type: 关闭
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-empty-interface': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/interface-name-prefix': 0,
// 必须是package.json里面的包: 关闭
'import/no-extraneous-dependencies': 0,
'import/prefer-default-export': 0,
},
};