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' ;
56import eslint from '@eslint/js' ;
6- import eslintConfigPrettier from 'eslint-config-prettier' ;
7- import eslintPluginVue from 'eslint-plugin-vue' ;
87import globals from 'globals' ;
9- import typescriptEslint from 'typescript-eslint' ;
108
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
1319 {
1420 files : [ '**/*.js' ] ,
1521 ...eslint . configs . recommended ,
@@ -18,45 +24,32 @@ export default typescriptEslint.config(
1824 sourceType : 'module' ,
1925 globals : {
2026 ...globals . browser ,
27+ ...globals . node ,
2128 process : 'readonly' ,
2229 module : 'readonly' ,
2330 require : 'readonly' ,
2431 window : 'readonly' ,
2532 } ,
2633 } ,
2734 } ,
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' ] ,
4352 } ,
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