eslint-plugin-vue-pug
eslint-plugin-vue-pug copied to clipboard
Add eslint flat config support
Flat config is going to be the default in eslint 9, this migrates/hacks the current generated conf into a flat version that can be used in eslint.config.js
import vuePug from 'eslint-plugin-vue-pug/flat'
export default [
// Other config
vuePug.configs['vue3-recommended'],
]
Thanks for working on this!
plugin-vue-pug is borrowing tools to generate configs from plugin-vue. They have created new scripts to accomodate flat configs in this PR. plugin-vue-pug should follow the same approach to stay in sync with them. It also looks like plugin-vue switched the default for configs to vue3 and now uses vue2- es prefix for configs. plugin-vue-pug should follow suite.
Do you want to look into borrowing from plugin-vue again?
Sure, I'll look into it.
On Tue, 2 Apr 2024, 16:44 rash, @.***> wrote:
Thanks for working on this!
plugin-vue-pug is borrowing tools to generate configs from plugin-vue. They have created new scripts to accomodate flat configs in this PR https://github.com/vuejs/eslint-plugin-vue/pull/2407. plugin-vue-pug should follow the same approach to stay in sync with them. It also looks like plugin-vue switched the default for configs to vue3 and now uses vue2- es prefix for configs. plugin-vue-pug should follow suite.
Do you want to look into borrowing from plugin-vue again?
— Reply to this email directly, view it on GitHub https://github.com/rashfael/eslint-plugin-vue-pug/pull/26#issuecomment-2032417111, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH7JJTEVI7EBN7I43AYM53Y3LG6JAVCNFSM6AAAAABFTIG4XGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZSGQYTOMJRGE . You are receiving this because you authored the thread.Message ID: @.***>
Hey, can you tell what status is for this issue? vue + eslint + pug still doesn't work in flat config
How to use eslint-plugin-pug in eslint flat. I use pug and eslint@9 in my vue project. There is a problem that that trouble me.
ts/consistent-type-imports rule will InstanceType<typeof Component> covert to import type Component from 'xxxxxx', but this is error
I need help. Thanks.
Unfortunately I've stopped working on the project that requires pug, so I haven't had the time to return to this.
Hopefully, someone else can make some progress.
Thanks for giving it a go @bahulneel ! I'll have a look at it again.
While we are here, I don't think vue-pug/component-name-in-template-casing works in ESLint 9. It crashes here:
https://github.com/rashfael/eslint-plugin-vue-pug/blob/826dbcfcf16a6082c48c3d7e319ecfb00dd69807/lib/rules/component-name-in-template-casing.js#L71
because there is no such thing as context.parserServices. Based on the documentation, I believe in fact there shouldn't be one, instead there should be context.sourceCode.parserServices.
Seeing the same issue as @IlyaSemenov just now…
TypeError: Error while loading rule 'vue-pug/component-name-in-template-casing': Cannot read properties of undefined (reading 'getTemplateBodyTokenStore')
at Object.create ([...]/node_modules/eslint-plugin-vue-pug/lib/rules/component-name-in-template-casing.js:71:30)
at createRuleListeners ([...]/node_modules/eslint/lib/linter/linter.js:942:21)
at [...]/node_modules/eslint/lib/linter/linter.js:1067:84
at Array.forEach (<anonymous>)
at runRules ([...]/node_modules/eslint/lib/linter/linter.js:998:34)
at Linter._verifyWithoutProcessors ([...]/node_modules/eslint/lib/linter/linter.js:1424:31)
at [...]/node_modules/eslint/lib/linter/linter.js:2100:29
at Array.map (<anonymous>)
at Linter._verifyWithProcessor ([...]/node_modules/eslint/lib/linter/linter.js:2095:37)
at Linter._verifyWithConfigArray ([...]/node_modules/eslint/lib/linter/linter.js:1987:25)