-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
106 lines (105 loc) · 2.91 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
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'plugin:vue/vue3-recommended',
'standard',
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [
'vue',
],
rules: {
'no-var': 'error',
// allow paren-less arrow functions
'arrow-parens': ['error', 'as-needed'],
// set maximum line characters
'max-len': ['error', {
code: 140,
ignoreUrls: true,
ignoreTemplateLiterals: true,
ignoreTrailingComments: true,
}],
complexity: ['error', 32],
quotes: ['error', 'single', {
avoidEscape: true,
allowTemplateLiterals: true,
}],
'no-console': 'off',
'comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'only-multiline',
}],
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-return-assign': 'off',
'no-unused-vars': 'error',
'no-empty': 'error',
'array-bracket-spacing': ['error', 'never'],
'object-curly-spacing': ['error', 'always'],
'space-before-function-paren': [
'error',
{
anonymous: 'always',
named: 'always',
asyncArrow: 'always',
},
],
'no-return-await': 'warn',
'object-shorthand': ['error', 'always'],
'no-extra-semi': 'error',
'prefer-const': ['error', {
destructuring: 'all',
ignoreReadBeforeAssign: true,
}],
'no-prototype-builtins': 'off',
'no-void': 'off',
'no-case-declarations': 'off',
'sort-imports': ['warn', {
ignoreDeclarationSort: true,
ignoreCase: true,
}],
'multiline-ternary': 'off',
// Not in override, these apply to non-.vue files too
'vue/require-default-prop': 'off',
'vue/require-prop-types': 'off',
'vue/one-component-per-file': 'off',
'vue/custom-event-name-casing': ['error', { ignores: ['/^[a-z]+(?:-[a-z]+)*:[a-z]+(?:-[a-z]+)*$/u'] }],
},
overrides: [
{
files: '**/*.vue',
rules: {
indent: 'off',
'vue/script-indent': ['error', 2, {
baseIndent: 1,
switchCase: 1,
ignores: [],
}],
'vue/html-closing-bracket-newline': ['error', {
singleline: 'never',
multiline: 'always',
}],
'vue/html-closing-bracket-spacing': 'error',
'vue/max-attributes-per-line': ['error', {
singleline: 5,
multiline: 1,
}],
'vue/valid-v-on': 'off', // This rule doesn't allow empty event listeners
'vue/no-v-html': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/valid-v-slot': ['error', { allowModifiers: true }],
'vue/multi-word-component-names': 'off',
},
},
],
}