@@ -3,54 +3,42 @@ import antfu from '@antfu/eslint-config'
33// https://github.com/antfu/eslint-config
44export default antfu (
55 {
6- vue : true ,
6+ vue : {
7+ overrides : {
8+ 'vue/block-order' : [ 'error' , {
9+ order : [ [ 'script' , 'template' ] , 'style' ] ,
10+ } ] , // 强制组件顶级元素的顺序
11+ 'vue/singleline-html-element-content-newline' : 'off' , // 要求在单行元素的内容前后换行
12+ 'vue/html-self-closing' : [ 'off' , {
13+ html : {
14+ void : 'never' ,
15+ normal : 'always' ,
16+ component : 'never' ,
17+ } ,
18+ } ] , // 强制自结束样式
19+ 'vue/custom-event-name-casing' : [ 'error' , 'kebab-case' ] , // 对自定义事件名称强制使用特定大小写
20+ } ,
21+ } ,
722 typescript : true ,
823 ignores : [
9- 'README.md' ,
10- 'src/types/shims-vue.d.ts'
11- ]
24+ '**/*.md' ,
25+ '.github' ,
26+ '.image' ,
27+ 'src/types/shims-vue.d.ts' ,
28+ ] ,
1229 } ,
1330 {
14- // Remember to specify the file glob here, otherwise it might cause the vue plugin to handle non-vue files
15- files : [ '**/*.vue' ] ,
1631 rules : {
17- 'vue/block-order' : [ 2 , {
18- order : [ [ 'script' , 'template' ] , 'style' ]
19- } ] , // 强制组件顶级元素的顺序
20- 'vue/html-self-closing' : [ 0 , {
21- html : {
22- void : 'never' ,
23- normal : 'always' ,
24- component : 'never'
25- }
26- } ] , // 强制自结束样式
27- 'vue/custom-event-name-casing' : [ 2 , 'kebab-case' ] , // 对自定义事件名称强制使用特定大小写
28- 'vue/singleline-html-element-content-newline' : 0 , // 要求在单行元素的内容前后换行
29- 'vue/first-attribute-linebreak' : 0 , // 强制第一个属性的位置
30- 'vue/define-macros-order' : [ 2 , {
31- order : [ 'defineOptions' , 'defineModel' , 'defineProps' , 'defineEmits' , 'defineSlots' ] ,
32- defineExposeLast : false
33- } ] , // 强制执行定义限制和定义弹出编译器宏的顺序
34- 'vue/html-indent' : 0 , // 在《模板》中强制一致的缩进
35- 'vue/html-closing-bracket-newline' : 0 // 要求或不允许在标记的右括号前换行
36- }
32+ 'curly' : [ 'off' , 'all' ] , // 对所有控制语句强制使用一致的大括号样式
33+ 'no-new' : 'off' , // 不允许在赋值或比较之外使用 new 运算符
34+ // 'no-console': 'error', // 禁止使用 console
35+ 'style/arrow-parens' : [ 'error' , 'always' ] , // 箭头函数参数需要括号
36+ 'style/brace-style' : [ 'error' , '1tbs' , { allowSingleLine : true } ] , // 对块执行一致的大括号样式
37+ 'regexp/no-unused-capturing-group' : 'off' ,
38+ 'regexp/no-super-linear-backtracking' : 'off' ,
39+ 'node/prefer-global/process' : 'off' ,
40+ 'antfu/top-level-function' : 'off' ,
41+ 'antfu/if-newline' : 'off' ,
42+ } ,
3743 } ,
38- {
39- // Without `files`, they are general rules for all files
40- rules : {
41- 'curly' : [ 0 , 'all' ] , // 对所有控制语句强制使用一致的大括号样式
42- 'dot-notation' : 0 , // 尽可能强制使用点表示法。 在 JavaScript 中,可以使用点表示法 (foo.bar) 或方括号表示法 (foo["bar"]) 访问属性
43- 'no-new' : 0 , // 不允许在赋值或比较之外使用 new 运算符
44- // 'no-console': 2, // 禁止使用 console
45- 'no-process-env' : 0 ,
46- 'style/arrow-parens' : [ 2 , 'always' ] , // 箭头函数参数需要括号
47- 'style/brace-style' : [ 2 , '1tbs' , { allowSingleLine : true } ] , // 对块执行一致的大括号样式
48- 'style/comma-dangle' : [ 2 , 'never' ] , // 要求或不允许尾随逗号
49- 'ts/consistent-type-definitions' : 0 ,
50- 'ts/no-unused-expressions' : 0 ,
51- 'node/prefer-global/process' : 0 ,
52- 'antfu/top-level-function' : 0 ,
53- 'antfu/if-newline' : 0
54- }
55- }
5644)
0 commit comments