-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy patheslint.shared.ts
More file actions
42 lines (39 loc) · 1.09 KB
/
eslint.shared.ts
File metadata and controls
42 lines (39 loc) · 1.09 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
import js from '@eslint/js'
import {
configureVueProject,
defineConfigWithVueTs,
vueTsConfigs
} from '@vue/eslint-config-typescript'
import gitignore from 'eslint-config-flat-gitignore'
import perfectionist from 'eslint-plugin-perfectionist'
import pluginVue from 'eslint-plugin-vue'
import { fileURLToPath, URL } from 'node:url'
configureVueProject({ scriptLangs: ['ts', 'js'] })
export function createConfig(metaUrl: string) {
const tsconfigRootDir = fileURLToPath(new URL('.', metaUrl))
return defineConfigWithVueTs(
gitignore(),
{
name: 'app/files-to-lint',
files: ['**/*.{ts,tsx,js,jsx,mts,cts,mjs,cjs,vue}']
},
js.configs.recommended,
pluginVue.configs['flat/essential'],
vueTsConfigs.recommended,
{
languageOptions: {
parserOptions: {
tsconfigRootDir
}
},
plugins: {
perfectionist
},
rules: {
'vue/multi-word-component-names': 'off',
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
'perfectionist/sort-imports': 'error'
}
}
)
}