Skip to content

Commit 38d68d8

Browse files
committed
fix: extend flat config
all the flat configs are exported as arrays.
1 parent 4907d65 commit 38d68d8

9 files changed

+280
-281
lines changed

Diff for: lib/configs/flat/base.js

+13-11
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55
*/
66
const globals = require('globals')
77
const vueEslintParser = require('vue-eslint-parser')
8-
module.exports = {
9-
languageOptions: {
10-
ecmaVersion: 2020,
11-
sourceType: 'module',
12-
parser: vueEslintParser,
13-
globals: globals.browser
14-
},
15-
rules: {
16-
'vue/comment-directive': 'error',
17-
'vue/jsx-uses-vars': 'error'
8+
module.exports = [
9+
{
10+
languageOptions: {
11+
ecmaVersion: 2020,
12+
sourceType: 'module',
13+
parser: vueEslintParser,
14+
globals: globals.browser
15+
},
16+
rules: {
17+
'vue/comment-directive': 'error',
18+
'vue/jsx-uses-vars': 'error'
19+
}
1820
}
19-
}
21+
]

Diff for: lib/configs/flat/essential.js

+91-89
Original file line numberDiff line numberDiff line change
@@ -4,93 +4,95 @@
44
* in order to update its content execute "npm run update"
55
*/
66
const extendedConfig = require('./base')
7-
module.exports = {
8-
extendedConfig,
9-
rules: {
10-
'vue/multi-word-component-names': 'warn',
11-
'vue/no-arrow-functions-in-watch': 'warn',
12-
'vue/no-async-in-computed-properties': 'warn',
13-
'vue/no-child-content': 'warn',
14-
'vue/no-computed-properties-in-data': 'warn',
15-
'vue/no-deprecated-data-object-declaration': 'warn',
16-
'vue/no-deprecated-destroyed-lifecycle': 'warn',
17-
'vue/no-deprecated-dollar-listeners-api': 'warn',
18-
'vue/no-deprecated-dollar-scopedslots-api': 'warn',
19-
'vue/no-deprecated-events-api': 'warn',
20-
'vue/no-deprecated-filter': 'warn',
21-
'vue/no-deprecated-functional-template': 'warn',
22-
'vue/no-deprecated-html-element-is': 'warn',
23-
'vue/no-deprecated-inline-template': 'warn',
24-
'vue/no-deprecated-props-default-this': 'warn',
25-
'vue/no-deprecated-router-link-tag-prop': 'warn',
26-
'vue/no-deprecated-scope-attribute': 'warn',
27-
'vue/no-deprecated-slot-attribute': 'warn',
28-
'vue/no-deprecated-slot-scope-attribute': 'warn',
29-
'vue/no-deprecated-v-bind-sync': 'warn',
30-
'vue/no-deprecated-v-is': 'warn',
31-
'vue/no-deprecated-v-on-native-modifier': 'warn',
32-
'vue/no-deprecated-v-on-number-modifiers': 'warn',
33-
'vue/no-deprecated-vue-config-keycodes': 'warn',
34-
'vue/no-dupe-keys': 'warn',
35-
'vue/no-dupe-v-else-if': 'warn',
36-
'vue/no-duplicate-attributes': 'warn',
37-
'vue/no-export-in-script-setup': 'warn',
38-
'vue/no-expose-after-await': 'warn',
39-
'vue/no-lifecycle-after-await': 'warn',
40-
'vue/no-mutating-props': 'warn',
41-
'vue/no-parsing-error': 'warn',
42-
'vue/no-ref-as-operand': 'warn',
43-
'vue/no-reserved-component-names': 'warn',
44-
'vue/no-reserved-keys': 'warn',
45-
'vue/no-reserved-props': [
46-
'warn',
47-
{
48-
vueVersion: 2
49-
}
50-
],
51-
'vue/no-shared-component-data': 'warn',
52-
'vue/no-side-effects-in-computed-properties': 'warn',
53-
'vue/no-template-key': 'warn',
54-
'vue/no-textarea-mustache': 'warn',
55-
'vue/no-unused-components': 'warn',
56-
'vue/no-unused-vars': 'warn',
57-
'vue/no-use-computed-property-like-method': 'warn',
58-
'vue/no-use-v-if-with-v-for': 'warn',
59-
'vue/no-useless-template-attributes': 'warn',
60-
'vue/no-v-for-template-key-on-child': 'warn',
61-
'vue/no-v-text-v-html-on-component': 'warn',
62-
'vue/no-watch-after-await': 'warn',
63-
'vue/prefer-import-from-vue': 'warn',
64-
'vue/require-component-is': 'warn',
65-
'vue/require-prop-type-constructor': 'warn',
66-
'vue/require-render-return': 'warn',
67-
'vue/require-slots-as-functions': 'warn',
68-
'vue/require-toggle-inside-transition': 'warn',
69-
'vue/require-v-for-key': 'warn',
70-
'vue/require-valid-default-prop': 'warn',
71-
'vue/return-in-computed-property': 'warn',
72-
'vue/return-in-emits-validator': 'warn',
73-
'vue/use-v-on-exact': 'warn',
74-
'vue/valid-attribute-name': 'warn',
75-
'vue/valid-define-emits': 'warn',
76-
'vue/valid-define-props': 'warn',
77-
'vue/valid-next-tick': 'warn',
78-
'vue/valid-template-root': 'warn',
79-
'vue/valid-v-bind': 'warn',
80-
'vue/valid-v-cloak': 'warn',
81-
'vue/valid-v-else-if': 'warn',
82-
'vue/valid-v-else': 'warn',
83-
'vue/valid-v-for': 'warn',
84-
'vue/valid-v-html': 'warn',
85-
'vue/valid-v-if': 'warn',
86-
'vue/valid-v-is': 'warn',
87-
'vue/valid-v-memo': 'warn',
88-
'vue/valid-v-model': 'warn',
89-
'vue/valid-v-on': 'warn',
90-
'vue/valid-v-once': 'warn',
91-
'vue/valid-v-pre': 'warn',
92-
'vue/valid-v-show': 'warn',
93-
'vue/valid-v-slot': 'warn',
94-
'vue/valid-v-text': 'warn'
7+
module.exports = [
8+
...extendedConfig,
9+
{
10+
rules: {
11+
'vue/multi-word-component-names': 'warn',
12+
'vue/no-arrow-functions-in-watch': 'warn',
13+
'vue/no-async-in-computed-properties': 'warn',
14+
'vue/no-child-content': 'warn',
15+
'vue/no-computed-properties-in-data': 'warn',
16+
'vue/no-deprecated-data-object-declaration': 'warn',
17+
'vue/no-deprecated-destroyed-lifecycle': 'warn',
18+
'vue/no-deprecated-dollar-listeners-api': 'warn',
19+
'vue/no-deprecated-dollar-scopedslots-api': 'warn',
20+
'vue/no-deprecated-events-api': 'warn',
21+
'vue/no-deprecated-filter': 'warn',
22+
'vue/no-deprecated-functional-template': 'warn',
23+
'vue/no-deprecated-html-element-is': 'warn',
24+
'vue/no-deprecated-inline-template': 'warn',
25+
'vue/no-deprecated-props-default-this': 'warn',
26+
'vue/no-deprecated-router-link-tag-prop': 'warn',
27+
'vue/no-deprecated-scope-attribute': 'warn',
28+
'vue/no-deprecated-slot-attribute': 'warn',
29+
'vue/no-deprecated-slot-scope-attribute': 'warn',
30+
'vue/no-deprecated-v-bind-sync': 'warn',
31+
'vue/no-deprecated-v-is': 'warn',
32+
'vue/no-deprecated-v-on-native-modifier': 'warn',
33+
'vue/no-deprecated-v-on-number-modifiers': 'warn',
34+
'vue/no-deprecated-vue-config-keycodes': 'warn',
35+
'vue/no-dupe-keys': 'warn',
36+
'vue/no-dupe-v-else-if': 'warn',
37+
'vue/no-duplicate-attributes': 'warn',
38+
'vue/no-export-in-script-setup': 'warn',
39+
'vue/no-expose-after-await': 'warn',
40+
'vue/no-lifecycle-after-await': 'warn',
41+
'vue/no-mutating-props': 'warn',
42+
'vue/no-parsing-error': 'warn',
43+
'vue/no-ref-as-operand': 'warn',
44+
'vue/no-reserved-component-names': 'warn',
45+
'vue/no-reserved-keys': 'warn',
46+
'vue/no-reserved-props': [
47+
'warn',
48+
{
49+
vueVersion: 2
50+
}
51+
],
52+
'vue/no-shared-component-data': 'warn',
53+
'vue/no-side-effects-in-computed-properties': 'warn',
54+
'vue/no-template-key': 'warn',
55+
'vue/no-textarea-mustache': 'warn',
56+
'vue/no-unused-components': 'warn',
57+
'vue/no-unused-vars': 'warn',
58+
'vue/no-use-computed-property-like-method': 'warn',
59+
'vue/no-use-v-if-with-v-for': 'warn',
60+
'vue/no-useless-template-attributes': 'warn',
61+
'vue/no-v-for-template-key-on-child': 'warn',
62+
'vue/no-v-text-v-html-on-component': 'warn',
63+
'vue/no-watch-after-await': 'warn',
64+
'vue/prefer-import-from-vue': 'warn',
65+
'vue/require-component-is': 'warn',
66+
'vue/require-prop-type-constructor': 'warn',
67+
'vue/require-render-return': 'warn',
68+
'vue/require-slots-as-functions': 'warn',
69+
'vue/require-toggle-inside-transition': 'warn',
70+
'vue/require-v-for-key': 'warn',
71+
'vue/require-valid-default-prop': 'warn',
72+
'vue/return-in-computed-property': 'warn',
73+
'vue/return-in-emits-validator': 'warn',
74+
'vue/use-v-on-exact': 'warn',
75+
'vue/valid-attribute-name': 'warn',
76+
'vue/valid-define-emits': 'warn',
77+
'vue/valid-define-props': 'warn',
78+
'vue/valid-next-tick': 'warn',
79+
'vue/valid-template-root': 'warn',
80+
'vue/valid-v-bind': 'warn',
81+
'vue/valid-v-cloak': 'warn',
82+
'vue/valid-v-else-if': 'warn',
83+
'vue/valid-v-else': 'warn',
84+
'vue/valid-v-for': 'warn',
85+
'vue/valid-v-html': 'warn',
86+
'vue/valid-v-if': 'warn',
87+
'vue/valid-v-is': 'warn',
88+
'vue/valid-v-memo': 'warn',
89+
'vue/valid-v-model': 'warn',
90+
'vue/valid-v-on': 'warn',
91+
'vue/valid-v-once': 'warn',
92+
'vue/valid-v-pre': 'warn',
93+
'vue/valid-v-show': 'warn',
94+
'vue/valid-v-slot': 'warn',
95+
'vue/valid-v-text': 'warn'
96+
}
9597
}
96-
}
98+
]

Diff for: lib/configs/flat/recommended.js

+13-11
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
* in order to update its content execute "npm run update"
55
*/
66
const extendedConfig = require('./strongly-recommended')
7-
module.exports = {
8-
extendedConfig,
9-
rules: {
10-
'vue/attributes-order': 'warn',
11-
'vue/component-tags-order': 'warn',
12-
'vue/no-lone-template': 'warn',
13-
'vue/no-multiple-slot-args': 'warn',
14-
'vue/no-v-html': 'warn',
15-
'vue/order-in-components': 'warn',
16-
'vue/this-in-template': 'warn'
7+
module.exports = [
8+
...extendedConfig,
9+
{
10+
rules: {
11+
'vue/attributes-order': 'warn',
12+
'vue/component-tags-order': 'warn',
13+
'vue/no-lone-template': 'warn',
14+
'vue/no-multiple-slot-args': 'warn',
15+
'vue/no-v-html': 'warn',
16+
'vue/order-in-components': 'warn',
17+
'vue/this-in-template': 'warn'
18+
}
1719
}
18-
}
20+
]

Diff for: lib/configs/flat/strongly-recommended.js

+31-29
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,35 @@
44
* in order to update its content execute "npm run update"
55
*/
66
const extendedConfig = require('./essential')
7-
module.exports = {
8-
extendedConfig,
9-
rules: {
10-
'vue/attribute-hyphenation': 'warn',
11-
'vue/component-definition-name-casing': 'warn',
12-
'vue/first-attribute-linebreak': 'warn',
13-
'vue/html-closing-bracket-newline': 'warn',
14-
'vue/html-closing-bracket-spacing': 'warn',
15-
'vue/html-end-tags': 'warn',
16-
'vue/html-indent': 'warn',
17-
'vue/html-quotes': 'warn',
18-
'vue/html-self-closing': 'warn',
19-
'vue/max-attributes-per-line': 'warn',
20-
'vue/multiline-html-element-content-newline': 'warn',
21-
'vue/mustache-interpolation-spacing': 'warn',
22-
'vue/no-multi-spaces': 'warn',
23-
'vue/no-spaces-around-equal-signs-in-attribute': 'warn',
24-
'vue/no-template-shadow': 'warn',
25-
'vue/one-component-per-file': 'warn',
26-
'vue/prop-name-casing': 'warn',
27-
'vue/require-default-prop': 'warn',
28-
'vue/require-explicit-emits': 'warn',
29-
'vue/require-prop-types': 'warn',
30-
'vue/singleline-html-element-content-newline': 'warn',
31-
'vue/v-bind-style': 'warn',
32-
'vue/v-on-event-hyphenation': 'warn',
33-
'vue/v-on-style': 'warn',
34-
'vue/v-slot-style': 'warn'
7+
module.exports = [
8+
...extendedConfig,
9+
{
10+
rules: {
11+
'vue/attribute-hyphenation': 'warn',
12+
'vue/component-definition-name-casing': 'warn',
13+
'vue/first-attribute-linebreak': 'warn',
14+
'vue/html-closing-bracket-newline': 'warn',
15+
'vue/html-closing-bracket-spacing': 'warn',
16+
'vue/html-end-tags': 'warn',
17+
'vue/html-indent': 'warn',
18+
'vue/html-quotes': 'warn',
19+
'vue/html-self-closing': 'warn',
20+
'vue/max-attributes-per-line': 'warn',
21+
'vue/multiline-html-element-content-newline': 'warn',
22+
'vue/mustache-interpolation-spacing': 'warn',
23+
'vue/no-multi-spaces': 'warn',
24+
'vue/no-spaces-around-equal-signs-in-attribute': 'warn',
25+
'vue/no-template-shadow': 'warn',
26+
'vue/one-component-per-file': 'warn',
27+
'vue/prop-name-casing': 'warn',
28+
'vue/require-default-prop': 'warn',
29+
'vue/require-explicit-emits': 'warn',
30+
'vue/require-prop-types': 'warn',
31+
'vue/singleline-html-element-content-newline': 'warn',
32+
'vue/v-bind-style': 'warn',
33+
'vue/v-on-event-hyphenation': 'warn',
34+
'vue/v-on-style': 'warn',
35+
'vue/v-slot-style': 'warn'
36+
}
3537
}
36-
}
38+
]

0 commit comments

Comments
 (0)