Repository navigation
Expand file tree
/
Copy patheslint.config.mjs
More file actions
76 lines (73 loc) · 1.84 KB
/
Copy patheslint.config.mjs
File metadata and controls
76 lines (73 loc) · 1.84 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
// eslint.config.js
import eslint from '@eslint/js';
import wdnsConfig from '@wdns/eslint-config-wdns';
import tseslint from 'typescript-eslint';
import AutoImportJson from './.eslintrc-auto-import.json' with { type: 'json' };
import { defineConfig, includeIgnoreFile } from 'eslint/config';
import { fileURLToPath, URL } from 'node:url';
const gitignorePath = fileURLToPath(new URL('.gitignore', import.meta.url));
export default defineConfig(
eslint.configs.recommended,
...tseslint.configs.recommended,
...wdnsConfig,
includeIgnoreFile(gitignorePath),
{
// your overrides
rules: {
// TypeScript allows a type and a value to share a name (e.g. component index.ts files)
'no-redeclare': 0,
},
},
{
ignores: [
'**/*.js',
'**/*.d.ts',
'eslint.config.mjs',
'public/**',
'src/playground/configs/templates/PlaygroundPage.vue',
'vite.build.config.mts',
'vite.config.mts',
'vitest.config.mts',
],
},
{
name: 'app/files-to-lint',
files: ['./src/**/*.{ts,mts,tsx,vue}'],
languageOptions: {
...AutoImportJson,
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
parser: tseslint.parser,
extraFileExtensions: ['.vue'],
sourceType: 'module',
},
},
plugins: {
'typescript-eslint': tseslint.plugin,
},
},
{
// Components destructure `toRefs(settings)` (merged attrs, props and global options),
// which intentionally reuses prop names.
name: 'app/plugin-components-settings-refs',
files: ['src/plugin/components/**/*.vue'],
rules: {
'vue/no-dupe-keys': 0,
},
},
{
// Documentation and playground files are plain JS and are not part of the tsconfig.
name: 'app/docs-and-playground',
files: ['src/**/*.{ts,vue}'],
ignores: ['src/plugin/**'],
languageOptions: {
parserOptions: {
projectService: false,
},
},
rules: {
'vue/block-lang': 0,
},
},
);