-
Notifications
You must be signed in to change notification settings - Fork 66
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
feat: flat config, eslint plugin, and nuxt module #332
Conversation
Amazing work 🚀 Question 1: do you plan to write a docs site like https://eslint.vuejs.org/ ? Of adding more content in https://nuxt.com/docs/guide/concepts/code-style could do the work? Q2: 100% agree with you, you have my go. |
I won't mind it being About Q2, I asked on Twitter, some comments for reference: https://twitter.com/antfu7/status/1767279700148174971 /cc @ricardogobbosouza in case you might have more insights about it. I personally wouldn't mind to have the module for ppl who need that capability (quicker feedback, IDE agnostic etc.), but I feel it shouldn't be the default eslint module. If want, we could also merge it into this repo, but with a different, more explicit name to indicate its approach. What do you think? |
Hi @antfu Q1: I believe that a website Q2: The module https://github.com/nuxt-modules/eslint is very useful, especially when we work as a team and not everyone has the IDE configured correctly, as mentioned by https://twitter.com/MatteoRigoni/status/1767466485834715328 In the
|
@ricardogobbosouza Thanks for the insights! Now I see the situation better, and yes, I think the dev server check makes sense in those cases. Tho I still think in a way it shouldn't be the default option, especially for beginners, and also I am a bit worried about the module name What do you think about the idea that we join the force merge them together as a single module, and we could have an explicit configuration like: export default defineNuxtConfig({
modules: ['@nuxt/eslint'],
eslint: {
checker: true // or an options object
}
}) (ofc, a better name is needed, I suppose it also blocks the build process so I didn't use So that we could even have a build time only checker only if ppl want: export default defineNuxtConfig({
modules: ['@nuxt/eslint'],
eslint: {
checker: {
dev: false,
build: true
}
}
}) WDYT? |
I agree, in merging into a single module
I agree to merge them together as a single module |
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.
Phenomenal work @antfu. I'm really happy with this direction - this will save all of us so much time and effort.
I'm sure you don't need permission, but do feel free to merge and iterate at will. ❤️
Co-authored-by: ricardogobbosouza <ricardogobbosouza@users.noreply.github.com>
Thanks to nuxt-modules/eslint#124 Co-authored-by: ModyQyW <ModyQyW@users.noreply.github.com>
Ok, this should be good to go. Tasks after this gets merged:
/cc @ricardogobbosouza If you got a chance to take a look, I have migrated the implementation of https://github.com/nuxt-modules/eslint. This is under an opt-in /cc @DamianGlowala If you have any comments |
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.
Nice @antfu
It's a good start to improving the user experience with eslint
- Need to add support for flat config in
webpack
if (isUsingFlatConfig) {
options.configType = 'flat'
options.eslintPath = 'eslint/use-at-your-own-risk'
options.overrideConfigFile: flatConfigFiles.filter(file => existsSync(resolve(nuxt.options.rootDir, file)))[0]
}
I can help you with some things, if you think it's necessary.
|
@ricardogobbosouza Yeah, I think it makes sense to keep supporting both for a while. For the next step, we will do some alpha releases to make sure everything works as expected. |
@antfu, thanks for this! Could you consider splitting the change to update the |
This PR will be merged soon, the basic |
Will a stable version be released soon? From the conversation I thought it would need some alpha/beta versions first. |
I suppose it would take around a week - but you can use beta version if you are hurry to upgrade |
For context, I'm updating Nx to support TS 5.4 (needed for Angular 17.3), TypeScript ESLint ^7.2.0, but it currently conflicts with our Nuxt support. We try to avoid generating projects using pre-release versions, so batching the TypeScript ESLint change (which seems a small change) together with a bigger feature set prevents using a stable version for other tooling. I'd be happy to send a separate PR with just that upgrade if you agree to split it. Otherwise, we're blocked or have to generate user projects with a pre-release version. |
I understand the situation - but you know, you can always use the package manager's resolutions to force an upgrade of your dependencies locally, use our beta release (which doesn't change anything for you), or wait a week for stable, or do local patch - there are multiple workarounds you can do. We as open-source projects, couldn't really release every different combination for every moving part to make it work for every situation - keeping everything the latest is the most reasonable path we could take. As this discussion is going off-topic, if you want to continue, I'd suggest you to create a separate issue. |
This PR merges the experiments in https://github.com/antfu/nuxt-module-eslint-config and made changes:
@nuxt/eslint-config
@nuxt/eslint-config/flat
@nuxt/eslint-plugin
process.env.dev
atm. We could add more later@nuxt/eslint
.nuxt/eslint.config.mjs
based on project structure and user configuration.After this PR, we could rename the repo to
nuxt/eslint
, as the central place for hosting eslint related Nuxt integrationsIssues
Features
Docs
@nuxtjs/eslint-config
from the README #311@nuxt/eslint-config
in the README nuxt-modules/eslint#114Upgrades
typescript-eslint
plugin version confilict. #330Open Questions
eslint.config.js
should be the single source of truth IMO. I would suggest we explain its downside in the README and soft-deprecate that module.