-
Notifications
You must be signed in to change notification settings - Fork 162
/
.eslintrc.js
108 lines (108 loc) · 3.05 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
102
103
104
105
106
107
108
module.exports = {
root: true,
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
env: {
browser: true,
node: true,
},
extends: ['plugin:vue/recommended', 'plugin:@typescript-eslint/recommended', 'airbnb-base'],
globals: {
__static: true,
},
plugins: ['vue'],
overrides: [
{
files: ['*.ts'],
rules: {
'no-dupe-class-members': 'off',
},
},
],
rules: {
'no-console': ['error', { allow: ['trace', 'warn', 'error', 'time', 'timeEnd'] }],
'no-unused-expressions': 0,
'no-unused-vars': 1,
'global-require': 0,
'import/no-unresolved': 0,
'no-param-reassign': 0,
'no-shadow': 0,
'dot-notation': 0,
'import/extensions': [
'error',
{ js: 'never', json: 'ignorePackages', vue: 'always', scss: 'always' },
],
'import/newline-after-import': 1,
'import/prefer-default-export': 0,
'prefer-destructuring': ['error', { AssignmentExpression: { array: false } }],
'no-multi-assign': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
// force the use of unix linebreak-syle
'linebreak-style': ['error', 'unix'],
// limit the cyclomatic complexity to 15
complexity: ['error', { max: 15 }],
// allow dangling after this and super
'no-underscore-dangle': ['error', { allowAfterThis: true, allowAfterSuper: true }],
// allow for-of and await in for-of loop
'no-restricted-syntax': 0,
'no-await-in-loop': 0,
indent: 'off',
'@typescript-eslint/indent': ['error', 2],
'vue/attributes-order': [
'error',
{
order: [
'DEFINITION',
'LIST_RENDERING',
'CONDITIONALS',
'RENDER_MODIFIERS',
'GLOBAL',
'UNIQUE',
'TWO_WAY_BINDING',
'OTHER_DIRECTIVES',
'OTHER_ATTR',
'EVENTS',
'CONTENT',
],
},
],
// temp disable as upgrade to new version
'no-undef': 0,
'no-redeclare': 0,
'no-empty-function': 0,
'no-use-before-define': 0,
'@typescript-eslint/ban-types': 0,
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-undef': 0,
'@typescript-eslint/no-use-before-define': 0,
// class methods can without use this
'class-methods-use-this': 0,
// can use types to define Obejct
'@typescript-eslint/prefer-interface': 0,
// JSON style for interfaces && types
'@typescript-eslint/member-delimiter-style': [1, {
multiline: {
delimiter: 'comma',
requireLast: true,
},
singleline: {
delimiter: 'comma',
requireLast: false,
},
}],
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-explicit-any': [
'error',
{
ignoreRestArgs: true,
},
],
},
};