Skip to content

Commit

Permalink
feat: support flat configs (#2407)
Browse files Browse the repository at this point in the history
Co-authored-by: Flo Edelmann <[email protected]>
  • Loading branch information
aladdin-add and FloEdelmann authored Mar 25, 2024
1 parent f84b8ee commit b22bd8b
Show file tree
Hide file tree
Showing 113 changed files with 722 additions and 142 deletions.
17 changes: 17 additions & 0 deletions lib/configs/flat/base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* IMPORTANT!
* This file has been automatically generated,
* in order to update its content execute "npm run update"
*/
const globals = require('globals')
module.exports = {
languageOptions: {
parser: require('vue-eslint-parser'),
sourceType: 'module',
globals: globals.browser
},
rules: {
'vue/comment-directive': 'error',
'vue/jsx-uses-vars': 'error'
}
}
76 changes: 76 additions & 0 deletions lib/configs/flat/vue2-essential.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* IMPORTANT!
* This file has been automatically generated,
* in order to update its content execute "npm run update"
*/
'use strict'
const config = require('./base.js')
const { extendRules } = require('../../utils/config-helpers.js')

const rules = {
'vue/multi-word-component-names': 'error',
'vue/no-arrow-functions-in-watch': 'error',
'vue/no-async-in-computed-properties': 'error',
'vue/no-child-content': 'error',
'vue/no-computed-properties-in-data': 'error',
'vue/no-custom-modifiers-on-v-model': 'error',
'vue/no-dupe-keys': 'error',
'vue/no-dupe-v-else-if': 'error',
'vue/no-duplicate-attributes': 'error',
'vue/no-export-in-script-setup': 'error',
'vue/no-multiple-template-root': 'error',
'vue/no-mutating-props': 'error',
'vue/no-parsing-error': 'error',
'vue/no-ref-as-operand': 'error',
'vue/no-reserved-component-names': 'error',
'vue/no-reserved-keys': 'error',
'vue/no-reserved-props': [
'error',
{
vueVersion: 2
}
],
'vue/no-shared-component-data': 'error',
'vue/no-side-effects-in-computed-properties': 'error',
'vue/no-template-key': 'error',
'vue/no-textarea-mustache': 'error',
'vue/no-unused-components': 'error',
'vue/no-unused-vars': 'error',
'vue/no-use-computed-property-like-method': 'error',
'vue/no-use-v-if-with-v-for': 'error',
'vue/no-useless-template-attributes': 'error',
'vue/no-v-for-template-key': 'error',
'vue/no-v-model-argument': 'error',
'vue/no-v-text-v-html-on-component': 'error',
'vue/require-component-is': 'error',
'vue/require-prop-type-constructor': 'error',
'vue/require-render-return': 'error',
'vue/require-v-for-key': 'error',
'vue/require-valid-default-prop': 'error',
'vue/return-in-computed-property': 'error',
'vue/return-in-emits-validator': 'error',
'vue/use-v-on-exact': 'error',
'vue/valid-attribute-name': 'error',
'vue/valid-define-emits': 'error',
'vue/valid-define-props': 'error',
'vue/valid-model-definition': 'error',
'vue/valid-next-tick': 'error',
'vue/valid-template-root': 'error',
'vue/valid-v-bind-sync': 'error',
'vue/valid-v-bind': 'error',
'vue/valid-v-cloak': 'error',
'vue/valid-v-else-if': 'error',
'vue/valid-v-else': 'error',
'vue/valid-v-for': 'error',
'vue/valid-v-html': 'error',
'vue/valid-v-if': 'error',
'vue/valid-v-model': 'error',
'vue/valid-v-on': 'error',
'vue/valid-v-once': 'error',
'vue/valid-v-pre': 'error',
'vue/valid-v-show': 'error',
'vue/valid-v-slot': 'error',
'vue/valid-v-text': 'error'
}

module.exports = extendRules(config, rules)
20 changes: 20 additions & 0 deletions lib/configs/flat/vue2-recommended.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* IMPORTANT!
* This file has been automatically generated,
* in order to update its content execute "npm run update"
*/
'use strict'
const config = require('./vue2-strongly-recommended.js')
const { extendRules } = require('../../utils/config-helpers.js')

const rules = {
'vue/attributes-order': 'warn',
'vue/component-tags-order': 'warn',
'vue/no-lone-template': 'warn',
'vue/no-multiple-slot-args': 'warn',
'vue/no-v-html': 'warn',
'vue/order-in-components': 'warn',
'vue/this-in-template': 'warn'
}

module.exports = extendRules(config, rules)
36 changes: 36 additions & 0 deletions lib/configs/flat/vue2-strongly-recommended.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* IMPORTANT!
* This file has been automatically generated,
* in order to update its content execute "npm run update"
*/
'use strict'
const config = require('./vue2-essential.js')
const { extendRules } = require('../../utils/config-helpers.js')

const rules = {
'vue/attribute-hyphenation': 'warn',
'vue/component-definition-name-casing': 'warn',
'vue/first-attribute-linebreak': 'warn',
'vue/html-closing-bracket-newline': 'warn',
'vue/html-closing-bracket-spacing': 'warn',
'vue/html-end-tags': 'warn',
'vue/html-indent': 'warn',
'vue/html-quotes': 'warn',
'vue/html-self-closing': 'warn',
'vue/max-attributes-per-line': 'warn',
'vue/multiline-html-element-content-newline': 'warn',
'vue/mustache-interpolation-spacing': 'warn',
'vue/no-multi-spaces': 'warn',
'vue/no-spaces-around-equal-signs-in-attribute': 'warn',
'vue/no-template-shadow': 'warn',
'vue/one-component-per-file': 'warn',
'vue/prop-name-casing': 'warn',
'vue/require-default-prop': 'warn',
'vue/require-prop-types': 'warn',
'vue/singleline-html-element-content-newline': 'warn',
'vue/v-bind-style': 'warn',
'vue/v-on-style': 'warn',
'vue/v-slot-style': 'warn'
}

module.exports = extendRules(config, rules)
93 changes: 93 additions & 0 deletions lib/configs/flat/vue3-essential.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
* IMPORTANT!
* This file has been automatically generated,
* in order to update its content execute "npm run update"
*/
'use strict'
const config = require('./base.js')
const { extendRules } = require('../../utils/config-helpers.js')

const rules = {
'vue/multi-word-component-names': 'error',
'vue/no-arrow-functions-in-watch': 'error',
'vue/no-async-in-computed-properties': 'error',
'vue/no-child-content': 'error',
'vue/no-computed-properties-in-data': 'error',
'vue/no-deprecated-data-object-declaration': 'error',
'vue/no-deprecated-destroyed-lifecycle': 'error',
'vue/no-deprecated-dollar-listeners-api': 'error',
'vue/no-deprecated-dollar-scopedslots-api': 'error',
'vue/no-deprecated-events-api': 'error',
'vue/no-deprecated-filter': 'error',
'vue/no-deprecated-functional-template': 'error',
'vue/no-deprecated-html-element-is': 'error',
'vue/no-deprecated-inline-template': 'error',
'vue/no-deprecated-props-default-this': 'error',
'vue/no-deprecated-router-link-tag-prop': 'error',
'vue/no-deprecated-scope-attribute': 'error',
'vue/no-deprecated-slot-attribute': 'error',
'vue/no-deprecated-slot-scope-attribute': 'error',
'vue/no-deprecated-v-bind-sync': 'error',
'vue/no-deprecated-v-is': 'error',
'vue/no-deprecated-v-on-native-modifier': 'error',
'vue/no-deprecated-v-on-number-modifiers': 'error',
'vue/no-deprecated-vue-config-keycodes': 'error',
'vue/no-dupe-keys': 'error',
'vue/no-dupe-v-else-if': 'error',
'vue/no-duplicate-attributes': 'error',
'vue/no-export-in-script-setup': 'error',
'vue/no-expose-after-await': 'error',
'vue/no-lifecycle-after-await': 'error',
'vue/no-mutating-props': 'error',
'vue/no-parsing-error': 'error',
'vue/no-ref-as-operand': 'error',
'vue/no-reserved-component-names': 'error',
'vue/no-reserved-keys': 'error',
'vue/no-reserved-props': 'error',
'vue/no-shared-component-data': 'error',
'vue/no-side-effects-in-computed-properties': 'error',
'vue/no-template-key': 'error',
'vue/no-textarea-mustache': 'error',
'vue/no-unused-components': 'error',
'vue/no-unused-vars': 'error',
'vue/no-use-computed-property-like-method': 'error',
'vue/no-use-v-if-with-v-for': 'error',
'vue/no-useless-template-attributes': 'error',
'vue/no-v-for-template-key-on-child': 'error',
'vue/no-v-text-v-html-on-component': 'error',
'vue/no-watch-after-await': 'error',
'vue/prefer-import-from-vue': 'error',
'vue/require-component-is': 'error',
'vue/require-prop-type-constructor': 'error',
'vue/require-render-return': 'error',
'vue/require-slots-as-functions': 'error',
'vue/require-toggle-inside-transition': 'error',
'vue/require-v-for-key': 'error',
'vue/require-valid-default-prop': 'error',
'vue/return-in-computed-property': 'error',
'vue/return-in-emits-validator': 'error',
'vue/use-v-on-exact': 'error',
'vue/valid-attribute-name': 'error',
'vue/valid-define-emits': 'error',
'vue/valid-define-props': 'error',
'vue/valid-next-tick': 'error',
'vue/valid-template-root': 'error',
'vue/valid-v-bind': 'error',
'vue/valid-v-cloak': 'error',
'vue/valid-v-else-if': 'error',
'vue/valid-v-else': 'error',
'vue/valid-v-for': 'error',
'vue/valid-v-html': 'error',
'vue/valid-v-if': 'error',
'vue/valid-v-is': 'error',
'vue/valid-v-memo': 'error',
'vue/valid-v-model': 'error',
'vue/valid-v-on': 'error',
'vue/valid-v-once': 'error',
'vue/valid-v-pre': 'error',
'vue/valid-v-show': 'error',
'vue/valid-v-slot': 'error',
'vue/valid-v-text': 'error'
}

module.exports = extendRules(config, rules)
20 changes: 20 additions & 0 deletions lib/configs/flat/vue3-recommended.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* IMPORTANT!
* This file has been automatically generated,
* in order to update its content execute "npm run update"
*/
'use strict'
const config = require('./vue3-strongly-recommended.js')
const { extendRules } = require('../../utils/config-helpers.js')

const rules = {
'vue/attributes-order': 'warn',
'vue/component-tags-order': 'warn',
'vue/no-lone-template': 'warn',
'vue/no-multiple-slot-args': 'warn',
'vue/no-v-html': 'warn',
'vue/order-in-components': 'warn',
'vue/this-in-template': 'warn'
}

module.exports = extendRules(config, rules)
44 changes: 44 additions & 0 deletions lib/configs/flat/vue3-strongly-recommended.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* IMPORTANT!
* This file has been automatically generated,
* in order to update its content execute "npm run update"
*/
'use strict'
const config = require('./vue3-essential.js')
const { extendRules } = require('../../utils/config-helpers.js')

const rules = {
'vue/attribute-hyphenation': 'warn',
'vue/component-definition-name-casing': 'warn',
'vue/first-attribute-linebreak': 'warn',
'vue/html-closing-bracket-newline': 'warn',
'vue/html-closing-bracket-spacing': 'warn',
'vue/html-end-tags': 'warn',
'vue/html-indent': 'warn',
'vue/html-quotes': 'warn',
'vue/html-self-closing': 'warn',
'vue/max-attributes-per-line': 'warn',
'vue/multiline-html-element-content-newline': 'warn',
'vue/mustache-interpolation-spacing': 'warn',
'vue/no-multi-spaces': 'warn',
'vue/no-spaces-around-equal-signs-in-attribute': 'warn',
'vue/no-template-shadow': 'warn',
'vue/one-component-per-file': 'warn',
'vue/prop-name-casing': 'warn',
'vue/require-default-prop': 'warn',
'vue/require-explicit-emits': 'warn',
'vue/require-prop-types': 'warn',
'vue/singleline-html-element-content-newline': 'warn',
'vue/v-bind-style': 'warn',
'vue/v-on-event-hyphenation': [
'warn',
'always',
{
autofix: true
}
],
'vue/v-on-style': 'warn',
'vue/v-slot-style': 'warn'
}

module.exports = extendRules(config, rules)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* in order to update its content execute "npm run update"
*/
module.exports = {
extends: require.resolve('./strongly-recommended'),
extends: require.resolve('./vue2-strongly-recommended'),
rules: {
'vue/attributes-order': 'warn',
'vue/component-tags-order': 'warn',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* in order to update its content execute "npm run update"
*/
module.exports = {
extends: require.resolve('./essential'),
extends: require.resolve('./vue2-essential'),
rules: {
'vue/attribute-hyphenation': 'warn',
'vue/component-definition-name-casing': 'warn',
Expand Down
Loading

0 comments on commit b22bd8b

Please sign in to comment.