Closed de-soul closed 2 years ago
Your Nuxt version is probably not super old, hence you should use ['@nuxtjs/eslint-module', { /* module options */ }]
syntax to set fix: true
and not in the eslint
key so
buildModules: [
['@nuxtjs/eslint-module', { fix: true }]
],
I'm still not sure what this is supposed to do. It is supposed to fix the errors, okay but when? Nothing works besides my usual ESlint extension.
EDIT: nvm, I found out that it does format it when the server is launched and with a little Husky configuration.
Could be nice to have more info on this one indeed. 😄
Hi! Actually, it is not possible for server-middleware or nuxt config and this module only adds a webpack plugin that works for codes handled by webpack like pages/
You can use an IDE plugin for the auto fix or yarn eslint --fix .
as an alternative.
Thanks for the confirmation Pooya!
Hello,
i'am using @nuxtjs/eslint-module in nuxt.config.js:
It works well and my nuxt files autofixed on save correctly, such as in ./layouts, /pages etc. But after adding middleware (Express):
ESLint and its plugins only checking /api files for errors, but dont autofixig them. I tryed to add /api folder to watch property under build options, but this do not have effect.