-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy patheslint.config.js
More file actions
59 lines (58 loc) · 1.66 KB
/
eslint.config.js
File metadata and controls
59 lines (58 loc) · 1.66 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
import js from '@eslint/js';
import vue from 'eslint-plugin-vue';
import prettier from 'eslint-config-prettier';
import globals from 'globals';
export default [
// Ignore patterns — keep dist/ and coverage/ here so IDE ESLint extensions
// (which read eslint.config.js directly, not the CLI allowlist) do not flag
// build artifacts. node_modules/ is excluded by ESLint by default.
{
ignores: ['dist/**', 'coverage/**', 'src/config/index.js'],
},
// Base configurations
js.configs.recommended,
...vue.configs['flat/recommended'],
prettier,
// Source files (browser environment)
{
files: ['src/**/*.{js,vue}'],
languageOptions: {
globals: globals.browser,
},
rules: {
'no-console': 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'vue/multi-word-component-names': 'off',
},
},
// Config files (Node environment)
{
files: ['*.config.js', 'scripts/**/*.js', 'src/config/**/*.js'],
languageOptions: {
globals: globals.node,
},
},
// Test files (Vitest)
{
files: ['tests/**/*.js', '**/*.test.js', '**/*.spec.js', '**/*.tests.js'],
languageOptions: {
globals: {
...globals.node,
global: 'readonly',
describe: 'readonly',
it: 'readonly',
test: 'readonly',
expect: 'readonly',
vi: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
beforeAll: 'readonly',
afterAll: 'readonly',
},
},
rules: {
// Test files use inline defineComponent wrappers — multiple components per file is expected
'vue/one-component-per-file': 'off',
},
},
];