nuxt-modules / eslint

ESLint module for Nuxt.js
MIT License
159 stars 15 forks source link

eslint autofix doesn't fire #12

Closed kakajansh closed 5 years ago

kakajansh commented 5 years ago

eslint autofix fires when manually extended build in nuxt.config.json

build: {
  extend(config, ctx) {
    config.module.rules.push({
      enforce: "pre",
      test: /\.(js|vue)$/,
      loader: "eslint-loader",
      exclude: /(node_modules)/,
      options: {
        fix: true
      }
    })
  }
}

but below code doesn't work

devModules: [
  '@nuxtjs/eslint-module'
],

eslint: {
  fix: true
},

nor

devModules: [
  ['@nuxtjs/eslint-module', { fix: true }]
],

fresh nuxt project v2.8.1

ricardogobbosouza commented 5 years ago

Hi @kakajansh I tried and I've not being able to reproduce your issue. Can you either provide repository or a GIF of the blink ?

kakajansh commented 5 years ago

I created new app with npx create-nuxt-app. It turns out that it didn't pull the latest version of nuxt-app. So there was installed "@nuxtjs/eslint-module": "^0.0.1" version. Upgrading deps resolves issue 👍

➜  npx create-nuxt-app nuxt-app
npx: installed 379 in 51.567s
create-nuxt-app v2.8.0
✨  Generating Nuxt.js project in /nuxt-app
? Project name nuxt-app
? Project description My divine Nuxt.js project
? Author name Kakajan SH
? Choose the package manager Npm
? Choose UI framework None
? Choose custom server framework None (Recommended)
? Choose Nuxt.js modules
? Choose linting tools ESLint
? Choose test framework None
? Choose rendering mode Single Page App

Maybe some related issues on create-nuxt-app repo:

begueradj commented 5 years ago

How did you fix this ? I have the same issue

ricardogobbosouza commented 5 years ago

@begueradj check version @nuxtjs/eslint-module please use the latest version v1.1.0

tetreault commented 4 years ago

npx create-nuxt-app still is using < v1.1.0

bf commented 3 years ago

I have the same issue, and my @nuxtjs/eslint-module is version 3.0.1

metasean commented 3 years ago

@ricardogobbosouza - I know this is an old issue, but I'm running into this with @nuxtjs/eslint-module 3.0.2.

Based on the fact that I'm running the latest published version and, in combination with @bf's comment, I really don't think the solution is "use the latest version".

Unfortunately, I haven't figured out a solution. If you have bandwidth to dig into this, doing so would be appreciated!

kissu commented 3 years ago

@metasean what's the issue with using the latest version?