1+ import js from "@eslint/js" ;
2+ import pluginVue from "eslint-plugin-vue" ;
3+ import * as parserVue from "vue-eslint-parser" ;
4+ import configPrettier from "eslint-config-prettier" ;
5+ import pluginPrettier from "eslint-plugin-prettier" ;
6+ import {
7+ defineFlatConfig
8+ } from "eslint-define-config" ;
9+ import * as parserTypeScript from "@typescript-eslint/parser" ;
10+ import pluginTypeScript from "@typescript-eslint/eslint-plugin" ;
11+ import globals from 'globals' ;
12+ 13+ export default defineFlatConfig ( [ {
14+ ...js . configs . recommended ,
15+ ignores : [
16+ "**/.*" ,
17+ "dist/*" ,
18+ "*.d.ts" ,
19+ "public/*" ,
20+ "src/assets/**"
21+ ] ,
22+ languageOptions : {
23+ globals : globals . browser
24+ } ,
25+ plugins : {
26+ prettier : pluginPrettier
27+ } ,
28+ rules : {
29+ ...configPrettier . rules ,
30+ ...pluginPrettier . configs . recommended . rules ,
31+ "no-debugger" : "off" ,
32+ "no-unused-vars" : [
33+ "error" ,
34+ {
35+ argsIgnorePattern : "^_" ,
36+ varsIgnorePattern : "^_"
37+ }
38+ ] ,
39+ "prettier/prettier" : [
40+ "error" ,
41+ {
42+ endOfLine : "auto"
43+ }
44+ ]
45+ }
46+ } ,
47+ {
48+ files : [ "**/*.?([cm])ts" , "**/*.?([cm])tsx" ] ,
49+ languageOptions : {
50+ parser : parserTypeScript ,
51+ parserOptions : {
52+ sourceType : "module"
53+ }
54+ } ,
55+ plugins : {
56+ "@typescript-eslint" : pluginTypeScript
57+ } ,
58+ rules : {
59+ ...pluginTypeScript . configs . strict . rules ,
60+ "@typescript-eslint/ban-types" : "off" ,
61+ "@typescript-eslint/no-redeclare" : "error" ,
62+ "@typescript-eslint/ban-ts-comment" : "off" ,
63+ "@typescript-eslint/no-explicit-any" : "off" ,
64+ "@typescript-eslint/prefer-as-const" : "warn" ,
65+ "@typescript-eslint/no-empty-function" : "off" ,
66+ "@typescript-eslint/no-non-null-assertion" : "off" ,
67+ "@typescript-eslint/no-import-type-side-effects" : "error" ,
68+ "@typescript-eslint/explicit-module-boundary-types" : "off" ,
69+ "@typescript-eslint/consistent-type-imports" : [
70+ "error" ,
71+ {
72+ disallowTypeAnnotations : false ,
73+ fixStyle : "inline-type-imports"
74+ }
75+ ] ,
76+ "@typescript-eslint/prefer-literal-enum-member" : [
77+ "error" ,
78+ {
79+ allowBitwiseExpressions : true
80+ }
81+ ] ,
82+ "@typescript-eslint/no-unused-vars" : [
83+ "error" ,
84+ {
85+ argsIgnorePattern : "^_" ,
86+ varsIgnorePattern : "^_"
87+ }
88+ ]
89+ }
90+ } ,
91+ {
92+ files : [ "**/*.d.ts" ] ,
93+ rules : {
94+ "eslint-comments/no-unlimited-disable" : "off" ,
95+ "import/no-duplicates" : "off" ,
96+ "unused-imports/no-unused-vars" : "off"
97+ }
98+ } ,
99+ {
100+ files : [ "**/*.?([cm])js" ] ,
101+ rules : {
102+ "@typescript-eslint/no-require-imports" : "off" ,
103+ "@typescript-eslint/no-var-requires" : "off"
104+ }
105+ } ,
106+ {
107+ files : [ "**/*.vue" ] ,
108+ languageOptions : {
109+ globals : {
110+ $ : "readonly" ,
111+ $$ : "readonly" ,
112+ $computed : "readonly" ,
113+ $customRef : "readonly" ,
114+ $ref : "readonly" ,
115+ $shallowRef : "readonly" ,
116+ $toRef : "readonly"
117+ } ,
118+ parser : parserVue ,
119+ parserOptions : {
120+ ecmaFeatures : {
121+ jsx : true
122+ } ,
123+ extraFileExtensions : [ ".vue" ] ,
124+ parser : "@typescript-eslint/parser" ,
125+ sourceType : "module"
126+ }
127+ } ,
128+ plugins : {
129+ vue : pluginVue
130+ } ,
131+ processor : pluginVue . processors [ ".vue" ] ,
132+ rules : {
133+ ...pluginVue . configs . base . rules ,
134+ ...pluginVue . configs [ "vue3-essential" ] . rules ,
135+ ...pluginVue . configs [ "vue3-recommended" ] . rules ,
136+ "no-undef" : "off" ,
137+ "no-unused-vars" : "off" ,
138+ "vue/no-v-html" : "off" ,
139+ "vue/require-default-prop" : "off" ,
140+ "vue/require-explicit-emits" : "off" ,
141+ "vue/multi-word-component-names" : "off" ,
142+ "vue/no-setup-props-reactivity-loss" : "off" ,
143+ "vue/html-self-closing" : [
144+ "error" ,
145+ {
146+ html : {
147+ void : "always" ,
148+ normal : "always" ,
149+ component : "always"
150+ } ,
151+ svg : "always" ,
152+ math : "always"
153+ }
154+ ]
155+ }
156+ }
157+ ] ) ;
0 commit comments