-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheslint.config.js
More file actions
108 lines (98 loc) · 2.83 KB
/
Copy patheslint.config.js
File metadata and controls
108 lines (98 loc) · 2.83 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
97
98
99
100
101
102
103
104
105
106
107
108
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginVue from 'eslint-plugin-vue';
import eslintConfigPrettier from 'eslint-config-prettier';
import vueI18n from '@intlify/eslint-plugin-vue-i18n';
export default [
// Global ignores
{
ignores: ['dist/**', 'node_modules/**', 'coverage/**', '**/*.json', '**/*.yml', '**/*.yaml', '**/*.md'],
},
// Base JavaScript recommended rules
js.configs.recommended,
// TypeScript recommended rules
...tseslint.configs.recommended,
// Vue recommended rules
...pluginVue.configs['flat/recommended'],
// Vue I18n plugin rules
...vueI18n.configs['flat/recommended'],
// Prettier compatibility (disables conflicting rules)
eslintConfigPrettier,
// Custom configuration for all files
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
// Node.js globals
process: 'readonly',
console: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
Buffer: 'readonly',
// Browser globals
window: 'readonly',
document: 'readonly',
navigator: 'readonly',
fetch: 'readonly',
URL: 'readonly',
URLSearchParams: 'readonly',
File: 'readonly',
FormData: 'readonly',
Blob: 'readonly',
FileReader: 'readonly',
HTMLElement: 'readonly',
HTMLInputElement: 'readonly',
HTMLFormElement: 'readonly',
Event: 'readonly',
DragEvent: 'readonly',
WheelEvent: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
crypto: 'readonly',
},
},
rules: {
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
},
},
// Vue-specific configuration
{
files: ['**/*.vue'],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
},
},
rules: {
'vue/multi-word-component-names': 'off',
},
},
// Vue I18n specific settings
{
files: ['**/*.vue', '**/*.ts', '**/*.js'],
settings: {
'vue-i18n': {
localeDir: './src/client/locales/*.json',
messageSyntaxVersion: '^9.0.0',
},
},
rules: {
'@intlify/vue-i18n/no-unused-keys': 'warn',
'@intlify/vue-i18n/no-missing-keys': 'error',
'@intlify/vue-i18n/no-raw-text': 'off', // Can be enabled if you want to enforce i18n for all text
'@intlify/vue-i18n/key-format-style': ['warn', 'camelCase'],
},
},
// Test files - allow 'any' for mocking
{
files: ['**/*.spec.ts', '**/*.test.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
];