1
- // https://eslint.org/docs/latest/use/configure/
2
- // https://eslint.vuejs.org/user-guide/
3
- // https://typescript-eslint.io/rules/?=recommended
4
-
1
+ import vue from 'eslint-plugin-vue' ;
2
+ import {
3
+ defineConfigWithVueTs ,
4
+ vueTsConfigs ,
5
+ } from '@vue/eslint-config-typescript' ;
5
6
import eslint from '@eslint/js' ;
6
- import eslintConfigPrettier from 'eslint-config-prettier' ;
7
- import eslintPluginVue from 'eslint-plugin-vue' ;
8
7
import globals from 'globals' ;
9
- import typescriptEslint from 'typescript-eslint' ;
10
8
11
- export default typescriptEslint . config (
12
- { ignores : [ '*.d.ts' , '**/coverage' , '**/dist' ] } ,
9
+ export default [
10
+ // Global ignores
11
+ {
12
+ ignores : [
13
+ 'node_modules' ,
14
+ 'dist' ,
15
+ 'public' ,
16
+ ] ,
17
+ } ,
18
+ // JavaScript files
13
19
{
14
20
files : [ '**/*.js' ] ,
15
21
...eslint . configs . recommended ,
@@ -18,45 +24,32 @@ export default typescriptEslint.config(
18
24
sourceType : 'module' ,
19
25
globals : {
20
26
...globals . browser ,
27
+ ...globals . node ,
21
28
process : 'readonly' ,
22
29
module : 'readonly' ,
23
30
require : 'readonly' ,
24
31
window : 'readonly' ,
25
32
} ,
26
33
} ,
27
34
} ,
28
- {
29
- files : [ '**/*.{ts,vue}' ] ,
30
- extends : [
31
- eslint . configs . recommended ,
32
- ...typescriptEslint . configs . recommended ,
33
- ...eslintPluginVue . configs [ 'flat/strongly-recommended' ] ,
34
- ] ,
35
- languageOptions : {
36
- ecmaVersion : 'latest' ,
37
- globals : {
38
- ...globals . browser ,
39
- } ,
40
- sourceType : 'module' ,
41
- parserOptions : {
42
- parser : typescriptEslint . parser ,
35
+ // Vue and TypeScript files
36
+ ...defineConfigWithVueTs (
37
+ vue . configs [ 'flat/recommended' ] ,
38
+ vueTsConfigs . recommended ,
39
+ {
40
+ rules : {
41
+ 'vue/require-default-prop' : 'off' ,
42
+ 'vue/attribute-hyphenation' : 'off' ,
43
+ 'vue/v-on-event-hyphenation' : 'off' ,
44
+ 'vue/multi-word-component-names' : 'off' ,
45
+ 'vue/block-lang' : 'off' ,
46
+ 'vue/no-v-html' : 'off' ,
47
+ 'vue/html-indent' : [ 'error' , 4 ] ,
48
+ '@typescript-eslint/no-explicit-any' : 'off' ,
49
+ indent : [ 'error' , 4 ] ,
50
+ semi : [ 'error' , 'always' ] ,
51
+ 'linebreak-style' : [ 'error' , 'unix' ] ,
43
52
} ,
44
- } ,
45
- rules : {
46
- 'vue/require-default-prop' : 'off' ,
47
- 'vue/attribute-hyphenation' : 'off' ,
48
- 'vue/v-on-event-hyphenation' : 'off' ,
49
- 'vue/multi-word-component-names' : 'off' ,
50
- 'vue/block-lang' : 'off' ,
51
- 'vue/first-attribute-linebreak' : [
52
- 'error' ,
53
- {
54
- singleline : 'ignore' ,
55
- multiline : 'ignore' ,
56
- } ,
57
- ] ,
58
- '@typescript-eslint/no-explicit-any' : 'off' ,
59
- } ,
60
- } ,
61
- eslintConfigPrettier
62
- ) ;
53
+ }
54
+ ) ,
55
+ ] ;
0 commit comments