1+ const { defineConfig } = require ( 'eslint-define-config' )
2+
3+ module . exports = defineConfig ( {
4+ // ESLint 一旦发现配置文件中有 "root": true,它就会停止在父级目录中寻找。
5+ root : true ,
6+ // 解析器
7+ parser : 'vue-eslint-parser' ,
8+ parserOptions : {
9+ // 解析器
10+ parser : '@typescript-eslint/parser' ,
11+ // js的版本
12+ ecmaVersion : 2020 ,
13+ // 模块化方案
14+ sourceType : 'module' ,
15+ ecmaFeatures : {
16+ jsx : true ,
17+ } ,
18+ } ,
19+ // 启用的规则
20+ extends : [ 'plugin:vue/vue3-recommended' , 'plugin:@typescript-eslint/recommended' , 'standard' ] ,
21+ rules : {
22+ quotes : [ 'error' , 'single' ] ,
23+ '@typescript-eslint/ban-ts-ignore' : 'off' ,
24+ '@typescript-eslint/explicit-function-return-type' : 'off' ,
25+ '@typescript-eslint/no-explicit-any' : 'off' ,
26+ '@typescript-eslint/no-var-requires' : 'off' ,
27+ '@typescript-eslint/no-empty-function' : 'off' ,
28+ '@typescript-eslint/no-use-before-define' : 'off' ,
29+ '@typescript-eslint/ban-ts-comment' : 'off' ,
30+ '@typescript-eslint/ban-types' : 'off' ,
31+ '@typescript-eslint/no-non-null-assertion' : 'off' ,
32+ '@typescript-eslint/explicit-module-boundary-types' : 'off' ,
33+ '@typescript-eslint/no-unused-vars' : [
34+ 'error' ,
35+ {
36+ argsIgnorePattern : '^h$' ,
37+ varsIgnorePattern : '^h$' ,
38+ } ,
39+ ] ,
40+ 'no-use-before-define' : 'off' ,
41+ 'no-unused-vars' : [
42+ 'error' ,
43+ {
44+ argsIgnorePattern : '^h$' ,
45+ varsIgnorePattern : '^h$' ,
46+ } ,
47+ ] ,
48+ 'no-tabs' : 'off' ,
49+ indent : 'off' ,
50+ 'vue/custom-event-name-casing' : 'off' ,
51+ 'vue/html-indent' : 'off' ,
52+ 'vue/max-attributes-per-line' : 'off' ,
53+ 'vue/html-self-closing' : 'off' ,
54+ 'vue/singleline-html-element-content-newline' : 'off' ,
55+ 'vue/multi-word-component-names' : 'off' ,
56+ 'space-before-function-paren' : 'off' ,
57+ 'comma-dangle' : 'off' ,
58+ } ,
59+ } )
0 commit comments