forked from the1812/Bilibili-Evolved
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
111 lines (106 loc) · 3.1 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
109
110
111
module.exports = {
env: {
browser: true,
es2020: true,
},
extends: [
'plugin:vue/recommended',
'plugin:@typescript-eslint/recommended',
'airbnb-base',
'plugin:prettier/recommended',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 2020,
parser: '@typescript-eslint/parser',
sourceType: 'module',
},
plugins: ['vue', '@typescript-eslint', 'prettier'],
rules: {
'prettier/prettier': 'error',
'import/no-unresolved': 'off',
'import/extensions': 'off',
'import/no-extraneous-dependencies': 'off',
'import/prefer-default-export': 'off',
'import/no-default-export': 'error',
'import/no-named-default': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-shadow': ['error', { builtinGlobals: false }],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'enumMember',
format: ['PascalCase'],
},
],
'vue/multi-word-component-names': 'off',
'vue/max-attributes-per-line': 'off',
'vue/html-self-closing': 'off',
'vue/no-v-html': 'off',
'vue/require-prop-types': 'off',
'vue/one-component-per-file': 'off',
'vue/singleline-html-element-content-newline': 'off',
// 使用 @typescript-eslint/no-unused-vars, 否则 interface 都是 unused
'no-unused-vars': 'off',
'no-console': 'off',
'no-undef': 'off',
'no-param-reassign': 'off',
'no-continue': 'off',
'no-plusplus': 'off',
'no-eval': 'off',
'no-useless-constructor': 'off',
'no-unused-expressions': 'off',
'no-await-in-loop': 'off',
'no-restricted-syntax': 'off',
'no-useless-escape': 'off',
'no-empty-function': ['error', { allow: ['constructors'] }],
'no-return-assign': ['error', 'except-parens'],
'no-redeclare': 'off',
'no-script-url': 'off',
'no-shadow': 'off',
'no-use-before-define': 'off',
'no-alert': 'off',
'no-restricted-globals': 'off',
'arrow-body-style': 'off',
'prefer-arrow-callback': 'off',
'object-curly-newline': 'off',
'linebreak-style': 'off',
camelcase: 'off',
'lines-between-class-members': 'off',
radix: ['error', 'as-needed'],
'max-classes-per-file': 'off',
'class-methods-use-this': 'off',
'prefer-destructuring': [
'error',
{
VariableDeclarator: {
array: false,
object: true,
},
AssignmentExpression: {
array: false,
object: false,
},
},
],
curly: ['error', 'all'],
},
overrides: [
{
files: ['*.vue', 'shims.d.ts', 'webpack/**/*.ts', 'registry/webpack/**/*.ts'],
rules: {
'import/no-default-export': 'off',
},
},
],
}