@@ -11,6 +11,11 @@ export default function vue(options: NuxtESLintConfigOptions): FlatConfigItem[]
11
11
const resolved = resolveOptions ( options )
12
12
const hasTs = resolved . features . typescript !== false
13
13
14
+ const {
15
+ indent = 2 ,
16
+ commaDangle = 'always-multiline' ,
17
+ } = typeof resolved . features . stylistic === 'boolean' ? { } : resolved . features . stylistic
18
+
14
19
return [
15
20
{
16
21
name : 'nuxt/vue/setup' ,
@@ -68,32 +73,45 @@ export default function vue(options: NuxtESLintConfigOptions): FlatConfigItem[]
68
73
'vue/component-tags-order' : undefined ,
69
74
'vue/block-order' : 'warn' ,
70
75
71
- // Include typescript eslint rules in *.vue files
72
- // https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended.ts
73
- 'constructor-super' : 'off' , // ts(2335) & ts(2377)
74
- 'getter-return' : 'off' , // ts(2378)
75
- 'no-const-assign' : 'off' , // ts(2588)
76
- 'no-dupe-args' : 'off' , // ts(2300)
77
- 'no-dupe-class-members' : 'off' , // ts(2393) & ts(2300)
78
- 'no-dupe-keys' : 'off' , // ts(1117)
79
- 'no-func-assign' : 'off' , // ts(2539)
80
- 'no-import-assign' : 'off' , // ts(2539) & ts(2540)
81
- 'no-new-symbol' : 'off' , // ts(7009)
82
- 'no-obj-calls' : 'off' , // ts(2349)
83
- 'no-redeclare' : 'off' , // ts(2451)
84
- 'no-setter-return' : 'off' , // ts(2408)
85
- 'no-this-before-super' : 'off' , // ts(2376)
86
- 'no-undef' : 'off' , // ts(2304)
87
- 'no-unreachable' : 'off' , // ts(7027)
88
- 'no-unsafe-negation' : 'off' , // ts(2365) & ts(2360) & ts(2358)
89
- 'no-var' : 'error' , // ts transpiles let/const to var, so no need for vars any more
90
- 'prefer-const' : 'error' , // ts provides better types with const
91
- 'prefer-rest-params' : 'error' , // ts provides better types with rest args over arguments
92
- 'prefer-spread' : 'error' , // ts transpiles spread to apply, so no need for manual apply
93
- 'valid-typeof' : 'off' , // ts(2367)
94
-
95
76
...( resolved . features . stylistic
96
- ? { }
77
+ ? {
78
+ 'vue/array-bracket-spacing' : [ 'error' , 'never' ] ,
79
+ 'vue/arrow-spacing' : [ 'error' , { after : true , before : true } ] ,
80
+ 'vue/block-spacing' : [ 'error' , 'always' ] ,
81
+ 'vue/block-tag-newline' : [
82
+ 'error' ,
83
+ {
84
+ multiline : 'always' ,
85
+ singleline : 'always' ,
86
+ } ,
87
+ ] ,
88
+ 'vue/brace-style' : [ 'error' , 'stroustrup' , { allowSingleLine : true } ] ,
89
+ 'vue/html-indent' : [ 'error' , indent ] ,
90
+ 'vue/html-quotes' : [ 'error' , 'double' ] ,
91
+ 'vue/comma-dangle' : [ 'error' , commaDangle ] ,
92
+ 'vue/comma-spacing' : [ 'error' , { after : true , before : false } ] ,
93
+ 'vue/comma-style' : [ 'error' , 'last' ] ,
94
+ 'vue/html-comment-content-spacing' : [
95
+ 'error' ,
96
+ 'always' ,
97
+ { exceptions : [ '-' ] } ,
98
+ ] ,
99
+ 'vue/key-spacing' : [ 'error' , { afterColon : true , beforeColon : false } ] ,
100
+ 'vue/keyword-spacing' : [ 'error' , { after : true , before : true } ] ,
101
+ 'vue/object-curly-newline' : 'off' ,
102
+ 'vue/object-curly-spacing' : [ 'error' , 'always' ] ,
103
+ 'vue/object-property-newline' : [
104
+ 'error' ,
105
+ { allowMultiplePropertiesPerLine : true } ,
106
+ ] ,
107
+ 'vue/one-component-per-file' : 'off' ,
108
+ 'vue/operator-linebreak' : [ 'error' , 'before' ] ,
109
+ 'vue/padding-line-between-blocks' : [ 'error' , 'always' ] ,
110
+ 'vue/quote-props' : [ 'error' , 'consistent-as-needed' ] ,
111
+ 'vue/require-default-prop' : 'off' ,
112
+ 'vue/space-in-parens' : [ 'error' , 'never' ] ,
113
+ 'vue/template-curly-spacing' : 'error' ,
114
+ }
97
115
: {
98
116
// Disable Vue's default stylistic rules when stylistic is not enabled
99
117
'vue/html-closing-bracket-newline' : undefined ,
0 commit comments