-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
62 lines (54 loc) · 2.02 KB
/
Copy patheslint.config.mjs
File metadata and controls
62 lines (54 loc) · 2.02 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
import js from '@eslint/js';
import pluginVue from 'eslint-plugin-vue';
import {
defineConfigWithVueTs,
vueTsConfigs,
configureVueProject,
} from '@vue/eslint-config-typescript';
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting';
// Globals для авто-импортов WXT/Vue (генерируется `wxt prepare`).
import autoImports from './.wxt/eslint-auto-imports.mjs';
configureVueProject({ rootDir: import.meta.dirname });
export default defineConfigWithVueTs(
// Что НЕ линтим.
{
ignores: ['.wxt/**', '.output/**', 'dist/**', 'node_modules/**', 'stats*.html'],
},
// WXT-globals должны идти раньше правил, иначе авто-импорты дадут no-undef.
autoImports,
js.configs.recommended,
pluginVue.configs['flat/recommended'],
vueTsConfigs.recommended,
// Проектные правила.
{
rules: {
// В небольшом расширении не требуем многословные имена компонентов.
'vue/multi-word-component-names': 'off',
},
},
// Content script монтирует несколько Vue-приложений (CapBar/QuarterBar) через createApp —
// правило «один компонент на файл» здесь неприменимо.
{
files: ['src/entrypoints/**/*.ts'],
rules: { 'vue/one-component-per-file': 'off' },
},
// E2E-скрипты: node-окружение + браузерные API внутри page.evaluate().
{
files: ['e2e/**/*.mjs'],
languageOptions: {
globals: {
console: 'readonly',
process: 'readonly',
document: 'readonly',
getComputedStyle: 'readonly',
location: 'readonly',
fetch: 'readonly',
URL: 'readonly',
performance: 'readonly',
chrome: 'readonly',
},
},
},
// Отключаем правила, конфликтующие с Prettier (форматирование делает Prettier).
skipFormatting,
);