-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
47 lines (46 loc) · 1.51 KB
/
eslint.config.js
File metadata and controls
47 lines (46 loc) · 1.51 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
45
46
47
import js from '@eslint/js'
import pluginVue from 'eslint-plugin-vue'
import globals from 'globals'
const isProd = process.env.NODE_ENV === 'production'
export default [
js.configs.recommended,
...pluginVue.configs['flat/recommended'],
{
files: [ '**/*.js' ],
languageOptions: {
sourceType: 'module',
globals: { ...globals.browser, ...globals.node },
},
rules: {
'indent': [ 'error', 2, { SwitchCase: 1 } ],
'comma-spacing': [ 'error', { before: false, after: true } ],
'key-spacing': [ 'error', { beforeColon: false, afterColon: true } ],
'no-multi-spaces': 'error',
'array-bracket-spacing': [ 'warn', 'always' ],
'comma-dangle': [ 'error', 'always-multiline' ],
'jsx-quotes': [ 'error', 'prefer-double' ],
'semi': [ 'error', 'never' ],
'no-console': isProd ? 'warn' : 'off',
'no-debugger': isProd ? 'warn' : 'off',
'no-unused-vars': 'warn',
'object-curly-spacing': [ 'warn', 'always' ],
'quotes': [ 'error', 'single' ],
'template-curly-spacing': [ 'warn', 'always' ],
},
},
{
files: [ '**/*.vue' ],
languageOptions: {
sourceType: 'module',
globals: { ...globals.browser, ...globals.node },
},
rules: {
'indent': 'off',
'vue/script-indent': [ 'error', 2, { baseIndent: 1 } ],
'vue/max-attributes-per-line': [ 'error', { singleline: 2 } ],
'vue/no-unused-components': 'warn',
'vue/no-v-html': 'off',
'vue/multi-word-component-names': 'off',
},
},
]