nuxt-modules / eslint

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

feat!: use `eslint-webpack-plugin` #40

Closed ricardogobbosouza closed 3 years ago

ricardogobbosouza commented 4 years ago

Resolve #38

BREAKING CHANGE:

codecov[bot] commented 4 years ago

Codecov Report

Merging #40 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #40   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           21        22    +1     
  Branches         2         2           
=========================================
+ Hits            21        22    +1     
Impacted Files Coverage Δ
lib/module.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8e64f1d...5b5e6f5. Read the comment docs.

zoxon commented 3 years ago

Do you test it before merging? Looks like module completely broken

rlam3 commented 3 years ago

Do you test it before merging? Looks like module completely broken

mines breaking too... idk where the upgrade guide is for this module... have you found a resolution or a work around?

toddheslin commented 3 years ago

Looks to be a problem with the cache. If pass:

eslint: {
    cache: false,
  },

In my nuxt.config.js then it won't generate the .eslintcache file which seems to be causing the trouble.

I like the idea of the cache but something has gone wrong through the upgrade.

rlam3 commented 3 years ago

@zoxon @toddheslin I did a quick doc for this upgrade. I believe upgrading from v2 to v3 was causing the problem. IDK if you are facing the same problem I was. But I got it to work after configuring the nuxt.config.js with eslint-webpack-plugin. It certainly was lacking in documentation.

https://aznric3boi91.medium.com/update-your-nuxtjs-eslint-module-from-v2-to-v3-20b5f0bcdb68

I also created a PR to update the docs as well. https://github.com/nuxt/nuxtjs.org/pull/1057

toddheslin commented 3 years ago

Awesome @rlam3 thanks for the article. Just a note for your 'after': you already destructured isDev and isClient so it should be (without ctx):

export default {
    // Run ESLint on save
  build: {
    extend(config, { isDev, isClient }) {
      if (isDev && isClient) {
        const options = {
          exclude: ['node_modules']
        }
        const EslintPlugin = require('eslint-webpack-plugin')
        config.plugins.push(new EslintPlugin(options))
    }
  }
}