I am creating a app with nuxt.js but everytime I launch the app, gives me the error of eslint and saying "potentially fixable with the --fix
option."
I did the command npm run lint -- --fix
and it works but then If I do another change in any vue file it comes again the same error and I have to do it again
Any idea of how to fix that?
Aug 7, 2020. ESLint's --fix option tells ESLint to fix whatever errors in your code that it knows how to fix.
npx eslint --fix . It fixes all files.
If you have the ESLint extension installed you can use CTRL+SHIFT+P to open the Command Palette. Then search for ESLint: Fix all auto-fixable Problems and press ENTER (or RETURN ).
Use the below configuration into nuxt config file:
build: { extend(config, ctx) { config.module.rules.push({ enforce: 'pre', test: /\.(js|vue)$/, loader: 'eslint-loader', exclude: /(node_modules)/, options: { fix: true } }) } }
Important part is:
options: { fix: true }
Extend the build in the nuxt.config.js
file
build: { extend(config, ctx) { config.module.rules.push({ enforce: "pre", test: /\.(js|vue)$/, loader: "eslint-loader", exclude: /(node_modules)/, options: { fix: true } }) } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With