-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy patheslint.config.mjs
More file actions
96 lines (90 loc) · 2.25 KB
/
eslint.config.mjs
File metadata and controls
96 lines (90 loc) · 2.25 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
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
import globals from 'globals'
import js from '@eslint/js'
import vue from 'eslint-plugin-vue'
import vueParser from 'vue-eslint-parser'
export default [
{
ignores: [
'**/dist/**',
'**/node_modules/**',
'**/.yarn/**',
'**/coverage/**',
'build/generated/**',
]
},
// Equivalent to `extends: ['eslint:recommended']` from .eslintrc
js.configs.recommended,
// Global rules for all files, code preference discussed in PR #181
{
rules: {
'no-trailing-spaces': 'warn'
// 'no-multiple-empty-lines': ['warn', { max: 1, maxEOF: 0, maxBOF: 0 }]
}
},
// Vue 3 recommended rules
...vue.configs['flat/recommended'],
// Browser app code (Vue SFCs + JS modules)
{
files: ['src/**/*.{js,vue}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser
},
parser: vueParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
}
},
plugins: { vue },
rules: {
// keep legacy behavior
'no-param-reassign': 'off',
// keep historical lenience for existing code (warn instead of error)
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
// Legacy Vue codebase compatibility
'vue/multi-word-component-names': 'off',
'vue/no-reserved-component-names': 'off'
}
},
// Editor components (dev tools) - allow prop mutation pattern
{
files: ['src/components/editor/**/*.vue'],
rules: {
'vue/no-mutating-props': 'off'
}
},
// Node scripts / tooling
{
files: ['bin/**/*.js', 'build/**/*.js', '*.config.cjs', '*.config.js', '*.config.ts'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'commonjs',
globals: {
...globals.node
}
},
rules: {
'no-console': 'off',
'no-empty': ['error', { allowEmptyCatch: true }]
}
}
,
// ESM config files
{
files: ['*.mjs', 'build/**/*.mjs', 'vite.config.mjs', 'eslint.config.mjs'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.node
}
},
rules: {
'no-console': 'off',
'no-empty': ['error', { allowEmptyCatch: true }]
}
}
]