-
-
Notifications
You must be signed in to change notification settings - Fork 681
Add support for generating ESLint Flat Config #2319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7abccec
Add support for generating ESLint Flat Config
conradhale 3f0895c
Merge branch 'master' into conradhale/master
FloEdelmann 580e176
Regenerate configs
FloEdelmann 0e6dcb8
Simplify function parameters
FloEdelmann ed384a3
Extract common comment into constant
FloEdelmann 4a8a6be
Fix tests
FloEdelmann 2b3113d
Fix indentation
FloEdelmann 8167d4a
Merge branch 'master' into conradhale/master
FloEdelmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* IMPORTANT! | ||
* This file has been automatically generated, | ||
* in order to update its content execute "npm run update" | ||
*/ | ||
const globals = require('globals') | ||
const vueEslintParser = require('vue-eslint-parser') | ||
module.exports = { | ||
languageOptions: { | ||
parser: vueEslintParser, | ||
globals: { | ||
...globals.browser, | ||
...globals.es2015 | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
sourceType: 'module' | ||
} | ||
}, | ||
rules: { | ||
'vue/comment-directive': 'error', | ||
'vue/jsx-uses-vars': 'error' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* IMPORTANT! | ||
* This file has been automatically generated, | ||
* in order to update its content execute "npm run update" | ||
*/ | ||
const extendedConfig = require('./base') | ||
module.exports = { | ||
extendedConfig, | ||
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' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* IMPORTANT! | ||
* This file has been automatically generated, | ||
* in order to update its content execute "npm run update" | ||
*/ | ||
const extendedConfig = require('./strongly-recommended') | ||
module.exports = { | ||
extendedConfig, | ||
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' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* IMPORTANT! | ||
* This file has been automatically generated, | ||
* in order to update its content execute "npm run update" | ||
*/ | ||
const extendedConfig = require('./essential') | ||
module.exports = { | ||
extendedConfig, | ||
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' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/* | ||
* IMPORTANT! | ||
* This file has been automatically generated, | ||
* in order to update its content execute "npm run update" | ||
*/ | ||
const extendedConfig = require('./base') | ||
module.exports = { | ||
extendedConfig, | ||
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' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* IMPORTANT! | ||
* This file has been automatically generated, | ||
* in order to update its content execute "npm run update" | ||
*/ | ||
const extendedConfig = require('./vue3-strongly-recommended') | ||
module.exports = { | ||
extendedConfig, | ||
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' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* IMPORTANT! | ||
* This file has been automatically generated, | ||
* in order to update its content execute "npm run update" | ||
*/ | ||
const extendedConfig = require('./vue3-essential') | ||
module.exports = { | ||
extendedConfig, | ||
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' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -255,7 +255,35 @@ module.exports = { | |
'strongly-recommended': require('./configs/strongly-recommended'), | ||
'vue3-essential': require('./configs/vue3-essential'), | ||
'vue3-recommended': require('./configs/vue3-recommended'), | ||
'vue3-strongly-recommended': require('./configs/vue3-strongly-recommended') | ||
'vue3-strongly-recommended': require('./configs/vue3-strongly-recommended'), | ||
'flat/base': { | ||
plugins: { vue: module }, | ||
...require('./configs/flat/base') | ||
}, | ||
'flat/essential': { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to change |
||
plugins: { vue: module }, | ||
...require('./configs/flat/essential') | ||
}, | ||
'flat/recommended': { | ||
plugins: { vue: module }, | ||
...require('./configs/flat/recommended') | ||
}, | ||
'flat/strongly-recommended': { | ||
plugins: { vue: module }, | ||
...require('./configs/flat/strongly-recommended') | ||
}, | ||
'flat/vue3-essential': { | ||
plugins: { vue: module }, | ||
...require('./configs/flat/vue3-essential') | ||
}, | ||
'flat/vue3-recommended': { | ||
plugins: { vue: module }, | ||
...require('./configs/flat/vue3-recommended') | ||
}, | ||
'flat/vue3-strongly-recommended': { | ||
plugins: { vue: module }, | ||
...require('./configs/flat/vue3-strongly-recommended') | ||
} | ||
}, | ||
processors: { | ||
'.vue': require('./processor') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In most cases, you don't need to specify
parserOptions
. just use:eslint will pass it to the parser. So you don't need to specify global.es2015 either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://eslint.org/docs/next/use/configure/language-options#specifying-javascript-options