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
docs: add eslint setup guide #24976
docs: add eslint setup guide #24976
Conversation
I found antfu's eslint package to be the best approach to enable eslint in a nuxt project and since its not really clear, I've documented it. So if people agree lets add it to the official docs?
Run & review this pull request in StackBlitz Codeflow. |
✅ Live Preview ready!
|
There's a WIP https://github.com/nuxt/eslint-plugin-nuxt made by the nuxt team so I think this would be the official way. |
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.
Hello 👋
we do have a roadmap for nuxt/eslint nuxt/eslint#303
Currently i'm using @nuxtjs/eslint-config-typescript
which works quite well i'd say
Hey, thanks for trying! I am working on a Nuxt module to generate a project-aware Nuxt configuration to make this easier. As the ESLint flat config is slowly becoming the standard, I believe it would make the best DX for Nuxt project. (while me, who made my own eslint config, do believe my eslint config works pretty well ofc. It's still quite opininated to my personal taste, and might not work for every Nuxt project. It would be better to maintain a Nuxt-official version and recommend it (which we do, but there could be a lot of improvements to make for sure)). |
Co-authored-by: skmedix <3246162+skmedix@users.noreply.github.com>
I've noticed, but the last update on that package was done on 2022. I do agree though that an official package would be much better. What I find interesting though is the zero config setup of Antfu's package which is in line with Nuxt's approach to many things like the module system. I'm fine with anything though. Just trying to help :) |
@chris-visser I appreciate your help 🙏and I'm just trying to do the same didn't mean to be aggressive or something. FYI I'm using antfu's package in my project and it's indeed zero-config and it's the Nuxt way as you said. I hope that official plugin get stabilized soon! |
Appreciate it ! |
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.
Let's update this to use @nuxt/eslint-config
for the moment. 🙏
Agree with @danielroe I do use Thank you for pushing this new page in the documentation @chris-visser ❤️ |
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.
Otherwise LGTM!
And btw, as promised, here I made a project-aware flat config generator module: https://github.com/antfu/nuxt-module-eslint-config, at some point we might make it official and mention it as the experiment support.
For better UX, I am thinking maybe this module could add an optional flag to opt-in ESLint for formatting via ESLint Stylisttc and eslint-plugin-format
(use Prettier for HTML and CSS).
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
I found @antfu 's eslint package to be the best approach to enable eslint in a Nuxt project and since imho its not really clear on how to set up eslint etc in Nuxt, I've documented it. So if people agree lets add it to the docs?