forked from lyswhut/lx-music-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
91 lines (89 loc) · 2.39 KB
/
.eslintrc.cjs
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
const javascript = {
'no-new': 'off',
camelcase: 'off',
'no-return-assign': 'off',
'space-before-function-paren': ['error', 'never'],
'no-var': 'error',
'no-fallthrough': 'off',
'prefer-promise-reject-errors': 'off',
eqeqeq: 'off',
'no-multiple-empty-lines': [1, { max: 2 }],
'comma-dangle': [2, 'always-multiline'],
'standard/no-callback-literal': 'off',
'prefer-const': 'off',
'no-labels': 'off',
'node/no-callback-literal': 'off',
'multiline-ternary': 'off',
}
const typescript = {
...javascript,
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/restrict-template-expressions': [1, {
allowBoolean: true,
}],
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/return-await': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/comma-dangle': 'off',
}
const vue = {
...typescript,
'vue/multi-word-component-names': 'off',
'vue/max-attributes-per-line': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/use-v-on-exact': 'off',
}
delete vue['@typescript-eslint/restrict-template-expressions']
module.exports = {
root: true,
extends: [
'standard',
],
plugins: [
'html',
],
parser: '@babel/eslint-parser',
parserOptions: {
// "requireConfigFile": false
},
rules: javascript,
ignorePatterns: ['vendors', '*.min.js', 'dist'],
overrides: [
{
files: ['*.vue'],
rules: vue,
parser: 'vue-eslint-parser',
extends: [
'plugin:vue/base',
// "plugin:vue/strongly-recommended"
'plugin:vue/vue3-recommended',
'plugin:vue-pug/vue3-recommended',
'standard-with-typescript',
],
parserOptions: {
sourceType: 'module',
parser: {
// Script parser for `<script>`
js: '@typescript-eslint/parser',
// Script parser for `<script lang="ts">`
ts: '@typescript-eslint/parser',
},
extraFileExtensions: ['.vue'],
},
},
{
files: ['*.ts'],
rules: typescript,
parser: '@typescript-eslint/parser',
extends: [
'standard-with-typescript',
],
parserOptions: {
project: './src/**/tsconfig.json',
},
},
],
}