-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy patheslint.config.mjs
More file actions
81 lines (75 loc) · 2.07 KB
/
Copy patheslint.config.mjs
File metadata and controls
81 lines (75 loc) · 2.07 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
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginVue from 'eslint-plugin-vue';
import prettierConfig from 'eslint-config-prettier';
export default tseslint.config(
// Global ignores
{
ignores: [
'node_modules/**',
'dist/**',
'out/**',
'coverage/**',
'**/*.js',
'**/*.cjs',
'**/*.mjs',
],
},
// Base JS recommended
js.configs.recommended,
// Base JS rule overrides (project-wide)
{
rules: {
// Terminal/ANSI processing code intentionally uses control characters in regex
'no-control-regex': 'off',
// prefer-const is covered by TypeScript compiler; avoid duplicate errors
'prefer-const': 'warn',
// Pattern of assigning then immediately reassigning is present in existing code
'no-useless-assignment': 'warn',
},
},
// TypeScript files
{
files: ['**/*.ts'],
extends: [
...tseslint.configs.recommended,
],
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/no-require-imports': 'warn',
// Keep as warn only — TypeScript compiler already enforces this
'prefer-const': 'warn',
},
},
// Vue SFC files (includes embedded TS)
{
files: ['**/*.vue'],
extends: [
...tseslint.configs.recommended,
...pluginVue.configs['flat/recommended'],
],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
extraFileExtensions: ['.vue'],
},
},
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/no-require-imports': 'warn',
// Vue-specific relaxations
'vue/multi-word-component-names': 'warn',
'vue/no-v-html': 'warn',
},
},
// Disable all rules that conflict with Prettier (must be last)
prettierConfig,
);