nuxt-modules / eslint

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

Upgrading from 2.0 to 3.0 causes issues #45

Closed moso closed 4 years ago

moso commented 4 years ago

I recently upgraded devDepencencies in a project, and discovered the following issue when running yarn dev:

× Client
  Compiled with some errors in 9.57s

 ERROR  Failed to compile with 1 errors  

This dependency was not found:

* <redacted>\.nuxt\client.js in multi eventsource-polyfill webpack-hot-middleware/client?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js

To install it, you can run: npm install --save <redacted>\.nuxt\client.js

 WARN  Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\hiberfil.sys'

 WARN  Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\pagefile.sys'

 WARN  Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\swapfile.sys'

As I narrowed it down, I came to the conclusion that this error only happens when this package is installed in version 3.0.0.

As this was an upgrade, I have no idea whether or not this exists in a new project. But I've upgraded all other packages used in the project. If I need extra/new packages of other packages, I assue the yarn install warning messages would tell me.

zoxon commented 4 years ago

Doesn't work for me, it just generates a lot of errors. I suppose this happens because this module try validate node_modules content.

Errors ```sh ERROR Failed to load config "ash-nazg/sauron-node" to extend from. 18:06:40 Referenced from: /Users/zoxon/work/public-g2-nuxt/node_modules/stackblur-canvas/.eslintrc.js Referenced from: node_modules/stackblur-canvas/.eslintrc.js at configMissingError (node_modules/@eslint/eslintrc/lib/config-array-factory.js:289:9) at ConfigArrayFactory._loadExtendedShareableConfig (node_modules/@eslint/eslintrc/lib/config-array-factory.js:877:23) at ConfigArrayFactory._loadExtends (node_modules/@eslint/eslintrc/lib/config-array-factory.js:780:25) at ConfigArrayFactory._normalizeObjectConfigDataBody (node_modules/@eslint/eslintrc/lib/config-array-factory.js:719:25) at _normalizeObjectConfigDataBody.next () at ConfigArrayFactory._normalizeObjectConfigData (node_modules/@eslint/eslintrc/lib/config-array-factory.js:664:20) at _normalizeObjectConfigData.next () at ConfigArrayFactory.loadInDirectory (node_modules/@eslint/eslintrc/lib/config-array-factory.js:510:28) at CascadingConfigArrayFactory._loadConfigInAncestors (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:378:46) at CascadingConfigArrayFactory._loadConfigInAncestors (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:397:20) at CascadingConfigArrayFactory.getConfigArrayForFile (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:299:18) at FileEnumerator._iterateFilesWithFile (node_modules/eslint/lib/cli-engine/file-enumerator.js:365:43) at FileEnumerator._iterateFiles (node_modules/eslint/lib/cli-engine/file-enumerator.js:346:25) at FileEnumerator.iterateFiles (node_modules/eslint/lib/cli-engine/file-enumerator.js:296:59) at iterateFiles.next () at CLIEngine.executeOnFiles (node_modules/eslint/lib/cli-engine/cli-engine.js:770:48) ERROR Failed to load config "developit" to extend from. 18:06:12 Referenced from: /Users/zoxon/work/public-g2-nuxt/node_modules/unfetch/package.json Referenced from: node_modules/unfetch/package.json at configMissingError (node_modules/@eslint/eslintrc/lib/config-array-factory.js:289:9) at ConfigArrayFactory._loadExtendedShareableConfig (node_modules/@eslint/eslintrc/lib/config-array-factory.js:877:23) at ConfigArrayFactory._loadExtends (node_modules/@eslint/eslintrc/lib/config-array-factory.js:780:25) at ConfigArrayFactory._normalizeObjectConfigDataBody (node_modules/@eslint/eslintrc/lib/config-array-factory.js:719:25) at _normalizeObjectConfigDataBody.next () at ConfigArrayFactory._normalizeObjectConfigData (node_modules/@eslint/eslintrc/lib/config-array-factory.js:664:20) at _normalizeObjectConfigData.next () at ConfigArrayFactory.loadInDirectory (node_modules/@eslint/eslintrc/lib/config-array-factory.js:510:28) at CascadingConfigArrayFactory._loadConfigInAncestors (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:378:46) at CascadingConfigArrayFactory._loadConfigInAncestors (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:397:20) at CascadingConfigArrayFactory.getConfigArrayForFile (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:299:18) at FileEnumerator._iterateFilesWithFile (node_modules/eslint/lib/cli-engine/file-enumerator.js:365:43) at FileEnumerator._iterateFiles (node_modules/eslint/lib/cli-engine/file-enumerator.js:346:25) at FileEnumerator.iterateFiles (node_modules/eslint/lib/cli-engine/file-enumerator.js:296:59) at iterateFiles.next () at CLIEngine.executeOnFiles (node_modules/eslint/lib/cli-engine/cli-engine.js:770:48) ERROR Failed to load plugin 'vue-libs' declared in 'node_modules/vue-loader/.eslintrc.js': Cannot find module 'eslint-plugin-vue-libs' 18:06:14 Require stack: - /Users/zoxon/work/public-g2-nuxt/node_modules/vue-loader/__placeholder__.js Referenced from: /Users/zoxon/work/public-g2-nuxt/node_modules/vue-loader/.eslintrc.js Require stack: - node_modules/vue-loader/__placeholder__.js Referenced from: node_modules/vue-loader/.eslintrc.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15) at Function.resolve (internal/modules/cjs/helpers.js:80:19) at Object.resolve (node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js:28:50) at ConfigArrayFactory._loadPlugin (node_modules/@eslint/eslintrc/lib/config-array-factory.js:1011:39) at ConfigArrayFactory._loadExtendedPluginConfig (node_modules/@eslint/eslintrc/lib/config-array-factory.js:831:29) at ConfigArrayFactory._loadExtends (node_modules/@eslint/eslintrc/lib/config-array-factory.js:778:29) at ConfigArrayFactory._normalizeObjectConfigDataBody (node_modules/@eslint/eslintrc/lib/config-array-factory.js:719:25) at _normalizeObjectConfigDataBody.next () at ConfigArrayFactory._normalizeObjectConfigData (node_modules/@eslint/eslintrc/lib/config-array-factory.js:664:20) at _normalizeObjectConfigData.next () at ConfigArrayFactory.loadInDirectory (node_modules/@eslint/eslintrc/lib/config-array-factory.js:510:28) at CascadingConfigArrayFactory._loadConfigInAncestors (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:378:46) at CascadingConfigArrayFactory._loadConfigInAncestors (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:397:20) at CascadingConfigArrayFactory._loadConfigInAncestors (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:397:20) at CascadingConfigArrayFactory.getConfigArrayForFile (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:299:18) at FileEnumerator._iterateFilesWithFile (node_modules/eslint/lib/cli-engine/file-enumerator.js:365:43) ERROR TypeError: Cannot read property 'kind' of undefined 18:06:25 TypeError: Cannot read property 'kind' of undefined at Object.isEntityNameExpression (/Users/zoxon/work/public-g2-nuxt/node_modules/typescript/lib/typescript.js:17115:21) at serializeMaybeAliasAssignment (/Users/zoxon/work/public-g2-nuxt/node_modules/typescript/lib/typescript.js:48356:42) at serializeSymbolWorker (/Users/zoxon/work/public-g2-nuxt/node_modules/typescript/lib/typescript.js:47874:49) at serializeSymbol (/Users/zoxon/work/public-g2-nuxt/node_modules/typescript/lib/typescript.js:47825:38) at /Users/zoxon/work/public-g2-nuxt/node_modules/typescript/lib/typescript.js:47800:25 at Map.forEach () at visitSymbolTable (/Users/zoxon/work/public-g2-nuxt/node_modules/typescript/lib/typescript.js:47799:33) at serializeAsNamespaceDeclaration (/Users/zoxon/work/public-g2-nuxt/node_modules/typescript/lib/typescript.js:48162:25) at serializeAsFunctionNamespaceMerge (/Users/zoxon/work/public-g2-nuxt/node_modules/typescript/lib/typescript.js:48123:25) at serializeMaybeAliasAssignment (/Users/zoxon/work/public-g2-nuxt/node_modules/typescript/lib/typescript.js:48401:29) ERROR Failed to load config "ash-nazg/sauron-node" to extend from. 18:06:40 Referenced from: /Users/zoxon/work/public-g2-nuxt/node_modules/stackblur-canvas/.eslintrc.js Referenced from: node_modules/stackblur-canvas/.eslintrc.js at configMissingError (node_modules/@eslint/eslintrc/lib/config-array-factory.js:289:9) at ConfigArrayFactory._loadExtendedShareableConfig (node_modules/@eslint/eslintrc/lib/config-array-factory.js:877:23) at ConfigArrayFactory._loadExtends (node_modules/@eslint/eslintrc/lib/config-array-factory.js:780:25) at ConfigArrayFactory._normalizeObjectConfigDataBody (node_modules/@eslint/eslintrc/lib/config-array-factory.js:719:25) at _normalizeObjectConfigDataBody.next () at ConfigArrayFactory._normalizeObjectConfigData (node_modules/@eslint/eslintrc/lib/config-array-factory.js:664:20) at _normalizeObjectConfigData.next () at ConfigArrayFactory.loadInDirectory (node_modules/@eslint/eslintrc/lib/config-array-factory.js:510:28) at CascadingConfigArrayFactory._loadConfigInAncestors (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:378:46) at CascadingConfigArrayFactory._loadConfigInAncestors (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:397:20) at CascadingConfigArrayFactory.getConfigArrayForFile (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:299:18) at FileEnumerator._iterateFilesWithFile (node_modules/eslint/lib/cli-engine/file-enumerator.js:365:43) at FileEnumerator._iterateFiles (node_modules/eslint/lib/cli-engine/file-enumerator.js:346:25) at FileEnumerator.iterateFiles (node_modules/eslint/lib/cli-engine/file-enumerator.js:296:59) at iterateFiles.next () at CLIEngine.executeOnFiles (node_modules/eslint/lib/cli-engine/cli-engine.js:770:48) ERROR Failed to load plugin 'html' declared in 'node_modules/vue-resize/.eslintrc.js': Cannot find module 'eslint-plugin-html' 18:06:53 Require stack: - /Users/zoxon/work/public-g2-nuxt/node_modules/vue-resize/__placeholder__.js Require stack: - node_modules/vue-resize/__placeholder__.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15) at Function.resolve (internal/modules/cjs/helpers.js:80:19) at Object.resolve (node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js:28:50) at ConfigArrayFactory._loadPlugin (node_modules/@eslint/eslintrc/lib/config-array-factory.js:1011:39) at node_modules/@eslint/eslintrc/lib/config-array-factory.js:902:33 at Array.reduce () at ConfigArrayFactory._loadPlugins (node_modules/@eslint/eslintrc/lib/config-array-factory.js:898:22) at ConfigArrayFactory._normalizeObjectConfigDataBody (node_modules/@eslint/eslintrc/lib/config-array-factory.js:724:44) at _normalizeObjectConfigDataBody.next () at ConfigArrayFactory._normalizeObjectConfigData (node_modules/@eslint/eslintrc/lib/config-array-factory.js:664:20) at _normalizeObjectConfigData.next () at ConfigArrayFactory.loadInDirectory (node_modules/@eslint/eslintrc/lib/config-array-factory.js:510:28) at CascadingConfigArrayFactory._loadConfigInAncestors (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:378:46) at CascadingConfigArrayFactory._loadConfigInAncestors (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:397:20) at CascadingConfigArrayFactory.getConfigArrayForFile (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:299:18) at FileEnumerator._iterateFilesWithFile (node_modules/eslint/lib/cli-engine/file-enumerator.js:365:43) ERROR Failed to load config "airbnb-base" to extend from. 18:06:59 Referenced from: /Users/zoxon/work/public-g2-nuxt/node_modules/v-click-outside/.eslintrc Referenced from: node_modules/v-click-outside/.eslintrc at configMissingError (node_modules/@eslint/eslintrc/lib/config-array-factory.js:289:9) at ConfigArrayFactory._loadExtendedShareableConfig (node_modules/@eslint/eslintrc/lib/config-array-factory.js:877:23) at ConfigArrayFactory._loadExtends (node_modules/@eslint/eslintrc/lib/config-array-factory.js:780:25) at ConfigArrayFactory._normalizeObjectConfigDataBody (node_modules/@eslint/eslintrc/lib/config-array-factory.js:719:25) at _normalizeObjectConfigDataBody.next () at ConfigArrayFactory._normalizeObjectConfigData (node_modules/@eslint/eslintrc/lib/config-array-factory.js:664:20) at _normalizeObjectConfigData.next () at ConfigArrayFactory.loadInDirectory (node_modules/@eslint/eslintrc/lib/config-array-factory.js:510:28) at CascadingConfigArrayFactory._loadConfigInAncestors (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:378:46) at CascadingConfigArrayFactory._loadConfigInAncestors (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:397:20) at CascadingConfigArrayFactory.getConfigArrayForFile (node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:299:18) at FileEnumerator._iterateFilesWithFile (node_modules/eslint/lib/cli-engine/file-enumerator.js:365:43) at FileEnumerator._iterateFiles (node_modules/eslint/lib/cli-engine/file-enumerator.js:346:25) at FileEnumerator.iterateFiles (node_modules/eslint/lib/cli-engine/file-enumerator.js:296:59) at iterateFiles.next () at CLIEngine.executeOnFiles (node_modules/eslint/lib/cli-engine/cli-engine.js:770:48) ERROR (node:94451) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 2) 18:07:12 ERROR (node:94451) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 3) 18:07:12 ERROR (node:94451) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 21) 18:07:12 ERROR (node:94451) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 22) 18:07:12 ERROR (node:94451) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 23) 18:07:12 ```

UPDATE: files options support array of strings. This helps when srcDir is .

export default {
  eslint: {
    files: ['.', '!node_modules']
  }
}
starzou commented 4 years ago

@zoxon eslint still not working

zoxon commented 4 years ago

@starzou any details?

vesper8 commented 4 years ago

Same here, updating "@nuxtjs/eslint-module": "^2.0.0", to "@nuxtjs/eslint-module": "^3.0.0", blows up everything and causes hundreds of errors

larzon83 commented 4 years ago

Doesn't work for me, it just generates a lot of errors. I suppose this happens because this module try validate node_modules content.

Errors UPDATE: files options support array of strings. This helps when srcDir is .

export default {
  eslint: {
    files: ['.', '!node_modules']
  }
}

This fixed it for me.

starzou commented 4 years ago

@zoxon Hello

Run the command in the terminal

> eslint --ext .vue,.js --ignore-path .gitignore .

/Users/test-user/the-nuxt-app/components/c-logo.vue
  3:7   error  Delete `⏎·····`                                      prettier/prettier
  5:11  error  Replace `⏎········class="img"·` with `·class="img"`  prettier/prettier

✖ 2 problems (2 errors, 0 warnings)
  2 errors and 0 warnings potentially fixable with the `--fix` option.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! the-nuxt-app@1.0.0 eslint: `eslint --ext .vue,.js --ignore-path .gitignore .`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the the-nuxt-app@1.0.0 eslint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Run with nuxt: No error output

> the-nuxt-app@1.0.0 dev /Users/test-user/the-nuxt-app
> nuxt

   ╭───────────────────────────────────────╮
   │                                       │
   │   Nuxt.js @ v2.14.7                   │
   │                                       │
   │   ▸ Environment: development          │
   │   ▸ Rendering:   client-side          │
   │   ▸ Target:      server               │
   │                                       │
   │   Listening: http://localhost:3000/   │
   │                                       │
   ╰───────────────────────────────────────╯

ℹ Preparing project for development                                                                                                                                                                                                                                                                                                                       11:55:23
ℹ Initial build may take a while                                                                                                                                                                                                                                                                                                                          11:55:23
✔ Builder initialized                                                                                                                                                                                                                                                                                                                                     11:55:23
✔ Nuxt files generated                                                                                                                                                                                                                                                                                                                                    11:55:23

✔ Client
  Compiled successfully in 2.70s

ℹ Waiting for file changes                                                                                                                                                                                                                                                                                                                                11:55:27
ℹ Memory usage: 240 MB (RSS: 327 MB)                                                                                                                                                                                                                                                                                                                      11:55:27
ℹ Listening on: http://localhost:3000/                                                                                                                                                                                                                                                                                                                    11:55:27
↻ Updated components/c-logo.vue                                                                                                                                                                                                                                                                                                                           11:55:38

✔ Client
  Compiled successfully in 957.65ms

↻ Updated components/c-logo.vue                                                                                                                                                                                                                                                                                                                           12:05:23

✔ Client
  Compiled successfully in 115.19ms

↻ Updated components/c-logo.vue                                                                                                                                                                                                                                                                                                                           12:05:26

✔ Client
  Compiled successfully in 84.04ms

nuxt.config.js

module.exports = {
  // Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
  buildModules: [
    // https://github.com/nuxt-community/style-resources-module
    '@nuxtjs/style-resources',
    // https://go.nuxtjs.dev/eslint
    '@nuxtjs/eslint-module',
    // https://go.nuxtjs.dev/stylelint
    '@nuxtjs/stylelint-module',
  ],

  styleResources: {
    scss: ['~assets/scss/variables.scss'],
  },

  eslint: {
    files: ['.', '!node_modules'],
  },

  stylelint: {
    fix: true,
    lintDirtyModulesOnly: true,
  },
};
zoxon commented 4 years ago

@starzou You right this module do not work's properly and don't lint any files. Looks like a bug in eslint-webpack-plugin

ricardogobbosouza commented 4 years ago

Problem on https://github.com/webpack-contrib/eslint-webpack-plugin I'm solving now

ricardogobbosouza commented 4 years ago

Waiting review https://github.com/webpack-contrib/eslint-webpack-plugin/pull/41

ricardogobbosouza commented 4 years ago

Fixed on v3.0.1

zoxon commented 4 years ago

Thank you very much