DEV Community

Discussion on: Adding ESLint and Prettier to Nuxt 3 ✨ (2023)

Collapse
 
kissu profile image
Konstantin BIFERT

Thanks for the article Lewis. πŸ™πŸ»

So, you're not extending the ESlint configuration with @nuxtjs as in here? That one is an old configuration that I used for a Nuxt2 project but I feel like a Vue linter is still needed.

A Vue3 or a Nuxt3 one would be even better to follow the latest rules with Composition API, accomodate Vue3 changes etc but I didn't took the time to find an exact configuration there (this one from Antfu is probably the closest best AFAIK).
Still, I feel like getting errors related to Prettier and mainly Vue is quite important.

I myself quite also enjoy having it on autosave as explained here with an Errorlens so that I can have various errors/warnings just next to my codebase while writing. Quite nazi for sure 😹 but it's great to not shift windows/context.

Collapse
 
tao profile image
Lewis Lloyd

Hey! 😸 Thanks for your comment.

The example extends @nuxtjs/eslint-config-typescript, which is recommended by the docs (github.com/nuxt/eslint-config#type...) for TypeScript support.

Just to prove it, here's Vue being annoyed for not using the v-bind: shorthand.

Screenshot of v-bind shorthand warning in console

You can extend @nuxtjs if you'd like to, which ESLint will assume to be the /eslint-config prefix.

Collapse
 
kissu profile image
Konstantin BIFERT

Oh damn, it's baked in? I didn't expect that one. Good to know. πŸ‘πŸ»