1
- // eslint.config.js
1
+ import eslint from '@eslint/js' ;
2
+ import eslintConfigPrettier from 'eslint-config-prettier' ;
3
+ import eslintPluginVue from 'eslint-plugin-vue' ;
4
+ import globals from 'globals' ;
5
+ import typescriptEslint from 'typescript-eslint' ;
2
6
3
- import { defineConfig } from 'eslint-define-config' ;
4
-
5
- export default defineConfig ( {
6
- env : {
7
- browser : true ,
8
- node : true ,
9
- es6 : true ,
10
- } ,
11
- parser : 'vue-eslint-parser' ,
12
- parserOptions : {
13
- parser : '@typescript-eslint/parser' ,
14
- ecmaVersion : 2020 ,
15
- sourceType : 'module' ,
16
- jsxPragma : 'React' ,
17
- ecmaFeatures : {
18
- jsx : true ,
19
- } ,
20
- project : './tsconfig.*?.json' ,
21
- createDefaultProgram : false ,
22
- extraFileExtensions : [ '.vue' ] ,
23
- } ,
24
- extends : [
25
- 'plugin:vue/vue3-recommended' ,
26
- 'plugin:@typescript-eslint/recommended' ,
27
- 'plugin:prettier/recommended' ,
28
- ] ,
29
- plugins : [ 'vue' , '@typescript-eslint' , 'import' ] ,
30
- rules : {
31
- 'no-unused-vars' : 'off' ,
32
- 'no-case-declarations' : 'off' ,
33
- 'no-use-before-define' : 'off' ,
34
- 'space-before-function-paren' : 'off' ,
35
- 'import/first' : 'error' ,
36
- 'import/newline-after-import' : 'error' ,
37
- 'import/no-duplicates' : 'error' ,
38
- '@typescript-eslint/no-unused-vars' : [
39
- 'error' ,
40
- {
41
- argsIgnorePattern : '^_' ,
42
- varsIgnorePattern : '^_' ,
43
- } ,
44
- ] ,
45
- '@typescript-eslint/ban-ts-ignore' : 'off' ,
46
- '@typescript-eslint/ban-ts-comment' : 'off' ,
47
- '@typescript-eslint/ban-types' : 'off' ,
48
- '@typescript-eslint/explicit-function-return-type' : 'off' ,
49
- '@typescript-eslint/no-explicit-any' : 'off' ,
50
- '@typescript-eslint/no-var-requires' : 'off' ,
51
- '@typescript-eslint/no-empty-function' : 'off' ,
52
- '@typescript-eslint/no-use-before-define' : 'off' ,
53
- '@typescript-eslint/no-non-null-assertion' : 'off' ,
54
- '@typescript-eslint/explicit-module-boundary-types' : 'off' ,
55
- 'vue/script-setup-uses-vars' : 'error' ,
56
- 'vue/no-reserved-component-names' : 'off' ,
57
- 'vue/custom-event-name-casing' : 'off' ,
58
- 'vue/attributes-order' : 'off' ,
59
- 'vue/one-component-per-file' : 'off' ,
60
- 'vue/html-closing-bracket-newline' : 'off' ,
61
- 'vue/max-attributes-per-line' : 'off' ,
62
- 'vue/multiline-html-element-content-newline' : 'off' ,
63
- 'vue/singleline-html-element-content-newline' : 'off' ,
64
- 'vue/attribute-hyphenation' : 'off' ,
65
- 'vue/require-default-prop' : 'off' ,
66
- 'vue/require-explicit-emits' : 'off' ,
67
- 'vue/html-self-closing' : [
68
- 'error' ,
69
- {
70
- html : {
71
- void : 'always' ,
72
- normal : 'never' ,
73
- component : 'always' ,
7
+ export default typescriptEslint . config (
8
+ { ignores : [ '*.d.ts' , '**/coverage' , '**/dist' ] } ,
9
+ {
10
+ extends : [ eslint . configs . recommended , ...typescriptEslint . configs . recommended , ...eslintPluginVue . configs [ 'flat/recommended' ] ] ,
11
+ files : [ '**/*.{ts,vue}' ] ,
12
+ languageOptions : {
13
+ ecmaVersion : 'latest' ,
14
+ sourceType : 'module' ,
15
+ globals : globals . browser ,
16
+ parserOptions : {
17
+ parser : typescriptEslint . parser ,
18
+ ecmaFeatures : {
19
+ jsx : true ,
74
20
} ,
75
- svg : 'always' ,
76
- math : 'always' ,
77
21
} ,
78
- ] ,
79
- 'vue/multi-word-component-names' : 'off' ,
22
+ } ,
23
+ rules : {
24
+ 'vue/multi-word-component-names' : 'off' ,
25
+ } ,
80
26
} ,
81
- globals : { defineOptions : 'readonly' } ,
82
- ignores : [
83
- '**/*.sh' ,
84
- 'node_modules' ,
85
- '**/*.md' ,
86
- '**/*.woff' ,
87
- '**/*.ttf' ,
88
- '.vscode' ,
89
- '.idea' ,
90
- 'dist' ,
91
- 'public' ,
92
- 'docs' ,
93
- '.husky' ,
94
- '.local' ,
95
- 'bin' ,
96
- 'Dockerfile' ,
97
- ] ,
98
- } ) ;
27
+ eslintConfigPrettier ,
28
+ ) ;
0 commit comments