-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.eslintrc.cjs
More file actions
44 lines (43 loc) · 1.36 KB
/
.eslintrc.cjs
File metadata and controls
44 lines (43 loc) · 1.36 KB
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
module.exports = {
root: true,
env: {
browser: true,
node: true,
es2022: true,
},
extends: ['eslint:recommended', 'plugin:vue/vue3-recommended', 'prettier'],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
eqeqeq: ['error', 'smart'],
quotes: ['error', 'single', { avoidEscape: true }],
semi: ['error', 'always'],
'comma-dangle': ['error', 'always-multiline'],
'object-curly-spacing': ['error', 'always'],
'arrow-parens': ['error', 'as-needed'],
// Vue 规则
'vue/multi-word-component-names': [
'warn',
{
ignores: ['Index', 'App', 'Layout', 'Home', 'About', 'Login'],
},
],
'vue/no-v-html': 'off',
'vue/require-default-prop': 'off',
'vue/html-self-closing': [
'error',
{
html: { void: 'always', normal: 'never', component: 'always' },
},
],
'vue/component-definition-name-casing': ['error', 'PascalCase'],
'vue/attribute-hyphenation': ['error', 'always'],
'vue/v-on-event-hyphenation': ['error', 'always'],
'vue/html-comment-content-spacing': ['error', 'always'],
},
};