nuxt-modules / eslint

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

ESLint didn't detect change when saving file #47

Closed prd-hop-duong closed 1 year ago

prd-hop-duong commented 3 years ago

Problem

Can someone take a look?

rlam3 commented 3 years ago

@prd-hop-duong were you able to find a workaround or a solution?

prd-hop-duong commented 3 years ago

@rlam3 Not yet, I temporarily turned off cache for work.

samburgers commented 3 years ago

Same here, had to disable the cache after going down the rabbit hole. Would you consider changing the default setting to false ?

It is easy to replicate with the basic create-nuxt-app if anyone is interested in digging into it.

manniL commented 3 years ago

Have seen this situation as well on Windows right now.

ricardogobbosouza commented 3 years ago

Hi @prd-hop-duong Fixed on v3.0.1 If the problem persists please reopen

prd-hop-duong commented 3 years ago

Hi @ricardogobbosouza Where's the commit to fix this issue? I already on this version v3.0.1 a month ago.

ricardogobbosouza commented 3 years ago

Hi @prd-hop-duong It was a fix on the eslint-webpack-plugin dependency Try rm -rf node_modules yarn.lock && yarn

prd-hop-duong commented 3 years ago

Hi @ricardogobbosouza It did not help, the issue still persists. The nuxt-app had the same problem if I updated the dependencies to latest. image

jscottsf commented 3 years ago

Spent two hours on this after an upgrade. Yes, the default seemed to change. Not seeing the fix in either the 3.0.1 or 3.0.2 commit.

jscottsf commented 3 years ago

I delete everything.

Then npm i with:

  "devDependencies": {
    "@babel/cli": "^7.12.10",
    "@babel/core": "^7.12.10",
    "@mdi/js": "^5.8.55",
    "@nuxtjs/eslint-config": "^5.0.0",
    "@nuxtjs/eslint-module": "^3.0.2",
    "eslint": "7.16.0",
    "eslint-config-prettier": "^7.1.0",
    "eslint-plugin-nuxt": "^2.0.0",
    "eslint-plugin-prettier": "^3.3.0",
    "prettier": "^2.2.1",
    "worker-loader": "^3.0.7"
  }

I look at node_modules and see:

    const options = {
    context: this.options.srcDir,
    eslintPath: 'eslint',
    extensions: ['js', 'ts', 'vue'],
    cache: true, // Please make this false!!!
    lintDirtyModulesOnly: true,
    ...this.options.eslint,
    ...moduleOptions
  }

Confirmed still an issue.

jscottsf commented 3 years ago

For anyone else suffering. Just specify this config with the module:

    ['@nuxtjs/eslint-module', { cache: false }],

This really impacts all sorts of things since no changes are detected. ESLint will complain about a problem. You'll fix it. Fix it again. Pull your hair out. Remove folders. Etc.

Noticed that the cache file appeared after upgrading. Glad it was eventually simple to fix.

riddla commented 3 years ago

@ricardogobbosouza, can you point us to the fix within eslint-webpack-plugin – I did not find anything mentioning the cache over at https://github.com/webpack-contrib/eslint-webpack-plugin/releases ...

Sikwan commented 3 years ago

Same problem on my end, did not find a way to fix by upgrading

YangAi commented 3 years ago

I tried to disable the cache setting today, and it suddenly deletes my entire project.

So, before modifying the settings, save a backup might be a good idea.