Skip to content

ESLint recursively trying to lint folders added by yarn link #3104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wellcaffeinated opened this issue Dec 10, 2018 · 5 comments
Closed

ESLint recursively trying to lint folders added by yarn link #3104

wellcaffeinated opened this issue Dec 10, 2018 · 5 comments
Labels
needs reproduction This issue is missing a minimal runnable reproduction, provided by the author scope: eslint

Comments

@wellcaffeinated
Copy link

Version

3.2.1

Environment info

 System:
    OS: macOS 10.14.1
    CPU: (4) x64 Intel(R) Core(TM) i5-7600 CPU @ 3.50GHz
  Binaries:
    Node: 8.11.2 - ~/.nvm/versions/node/v8.11.2/bin/node
    Yarn: 1.12.3 - /usr/local/bin/yarn
    npm: 5.6.0 - ~/.nvm/versions/node/v8.11.2/bin/npm
  Browsers:
    Chrome: 70.0.3538.110
    Firefox: 63.0.3
    Safari: 12.0.1
  npmPackages:
    @vue/babel-preset-app:  3.2.0
    @vue/cli-overlay:  3.2.0
    @vue/cli-plugin-babel: ^3.2.0 => 3.2.0
    @vue/cli-plugin-eslint: ^3.2.0 => 3.2.1
    @vue/cli-service: ^3.2.0 => 3.2.0
    @vue/cli-shared-utils:  3.2.0
    @vue/component-compiler-utils:  2.3.0
    @vue/preload-webpack-plugin:  1.1.0
    @vue/web-component-wrapper:  1.2.0
    babel-helper-vue-jsx-merge-props:  2.0.3
    babel-plugin-transform-vue-jsx:  4.0.1
    eslint-plugin-vue: ^5.0.0-0 => 5.0.0
    vue: ^2.5.17 => 2.5.19
    vue-eslint-parser:  4.0.3
    vue-hot-reload-api:  2.3.1
    vue-loader:  15.4.2
    vue-router: ^3.0.2 => 3.0.2
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.5.17 => 2.5.19
    vue-template-es2015-compiler:  1.6.0
  npmGlobalPackages:
    @vue/cli: 3.2.1

Steps to reproduce

Using yarn link to add a local package folder to node_modules results in es-lint checking the .eslintrc in the package directory.

What is expected?

No errors

What is actually happening?

Project directory: /Users/wellcaffeinated/Documents/github/minutelabsio/what-is-a-day

using yarn link to add "frames.js" directory.

When importing the module into a .vue file, i get this error:

Module build failed (from ./node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js):
Error: Cannot find module 'eslint-config-standard'
Referenced from: /Users/wellcaffeinated/Documents/github/frames.js/.eslintrc
    at ModuleResolver.resolve (/Users/wellcaffeinated/Documents/github/minutelabsio/what-is-a-day/node_modules/eslint/lib/util/module-resolver.js:72:19)
    at resolve (/Users/wellcaffeinated/Documents/github/minutelabsio/what-is-a-day/node_modules/eslint/lib/config/config-file.js:484:28)
    at load (/Users/wellcaffeinated/Documents/github/minutelabsio/what-is-a-day/node_modules/eslint/lib/config/config-file.js:556:26)
    at configExtends.reduceRight (/Users/wellcaffeinated/Documents/github/minutelabsio/what-is-a-day/node_modules/eslint/lib/config/config-file.js:430:36)
    at Array.reduceRight (<anonymous>)
    at applyExtends (/Users/wellcaffeinated/Documents/github/minutelabsio/what-is-a-day/node_modules/eslint/lib/config/config-file.js:408:26)
    at loadFromDisk (/Users/wellcaffeinated/Documents/github/minutelabsio/what-is-a-day/node_modules/eslint/lib/config/config-file.js:528:22)
    at Object.load (/Users/wellcaffeinated/Documents/github/minutelabsio/what-is-a-day/node_modules/eslint/lib/config/config-file.js:564:20)
    at Config.getLocalConfigHierarchy (/Users/wellcaffeinated/Documents/github/minutelabsio/what-is-a-day/node_modules/eslint/lib/config.js:240:44)
    at Config.getConfigHierarchy (/Users/wellcaffeinated/Documents/github/minutelabsio/what-is-a-day/node_modules/eslint/lib/config.js:192:43)
    at Config.getConfigVector (/Users/wellcaffeinated/Documents/github/minutelabsio/what-is-a-day/node_modules/eslint/lib/config.js:299:21)
    at Config.getConfig (/Users/wellcaffeinated/Documents/github/minutelabsio/what-is-a-day/node_modules/eslint/lib/config.js:342:29)
    at processText (/Users/wellcaffeinated/Documents/github/minutelabsio/what-is-a-day/node_modules/eslint/lib/cli-engine.js:180:33)
    at CLIEngine.executeOnText (/Users/wellcaffeinated/Documents/github/minutelabsio/what-is-a-day/node_modules/eslint/lib/cli-engine.js:686:40)
    at lint (/Users/wellcaffeinated/Documents/github/minutelabsio/what-is-a-day/node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js:253:17)
    at transform (/Users/wellcaffeinated/Documents/github/minutelabsio/what-is-a-day/node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js:231:18)

You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.

Tried "no-eslintrc": true in eslintConfig. No effect.
Tried adding node_modules to .eslintignore. No effect.
Want to disable eslint's checking of the node_modules directory

@LinusBorg LinusBorg added needs reproduction This issue is missing a minimal runnable reproduction, provided by the author scope: eslint labels Dec 10, 2018
@wellcaffeinated
Copy link
Author

Workaround:

// vue.config.js
module.exports = {
  // ...
  configureWebpack: {
    resolve: { symlinks: false }
  }
}

@haoqunjiang
Copy link
Member

So it's not a bug in Vue CLI. It's by design (of webpack).

@wellcaffeinated
Copy link
Author

Maybe so, but I think vue CLI might want to set this option by default. I was banging my head against the desk for a while before I figured this out. Seems like a normal use-case, and there's no reason eslint should be checking node_modules for further configuration

@haoqunjiang
Copy link
Member

See #2409

@facuescobar
Copy link

Thanks!
This worked for me!

resolve: {
        symlinks: false,
    },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproduction This issue is missing a minimal runnable reproduction, provided by the author scope: eslint
Projects
None yet
Development

No branches or pull requests

4 participants