Skip to content
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

Scoped npm packages on Windows do not seem to work #5644

Closed
robertrossmann opened this issue Mar 22, 2016 · 8 comments
Closed

Scoped npm packages on Windows do not seem to work #5644

robertrossmann opened this issue Mar 22, 2016 · 8 comments
Assignees
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features

Comments

@robertrossmann
Copy link
Contributor

Hello,

it looks like scoped packages do not work correctly on Windows machines. Below you can see that eslint is trying to load a configuration from @strv\javascript\standard\optional.js/eslint-config, while the correct place to load it from would be @strv\eslint-config-javascript\standard\optional.js.

To provide more context, the file @strv/javascript/environments/nodejs/optional.js contains a relative reference to another configuration file via extends property:

module.exports = {
  extends: '../../standard/optional.js'
}

If it helps, the whole configuration package is publicly available here.

I wonder if this is an issue with ESLint or with the configuration package. On OS X, this configuration package works without issues.

Thank you for your help!

What version of ESLint are you using? 2.4.0

What parser (default, Babel-ESLint, etc.) are you using? default

Please show your full configuration:

// .eslintrc.js
module.exports = {
  extends: [
    '@strv/javascript/environments/nodejs/latest',
    '@strv/javascript/environments/nodejs/best-practices',
    '@strv/javascript/environments/nodejs/optional'
  ],

  rules: {
    'valid-jsdoc': 2
  }
}

What actually happened? Please include the actual, raw output from ESLint.

Cannot find module '@strv\javascript\standard\optional.js/eslint-config' from 'C:\project-root\node_modules\@strv\eslint-config-javascript\environments\nodejs'
Referenced from: @strv/javascript/environments/nodejs/optional
Referenced from: C:\project-root\.eslintrc.js
Error: Cannot find module '@strv\javascript\standard\optional.js/eslint-config' from 'C:\project-root\node_modules\@strv\eslint-config-javascript\environments\nodejs'
Referenced from: @strv/javascript/environments/nodejs/optional
Referenced from: C:\project-root\.eslintrc.js
   at Function.module.exports [as sync] (C:\project-root\node_modules\resolve\lib\sync.js:33:11)
   at resolve (C:\project-root\node_modules\eslint\lib\config\config-file.js:416:38)
   at load (C:\project-root\node_modules\eslint\lib\config\config-file.js:435:24)
   at C:\project-root\node_modules\eslint\lib\config\config-file.js:355:36
   at Array.reduceRight (native)
   at applyExtends (C:\project-root\node_modules\eslint\lib\config\config-file.js:338:28)
   at load (C:\project-root\node_modules\eslint\lib\config\config-file.js:462:22)
   at C:\project-root\node_modules\eslint\lib\config\config-file.js:355:36
   at Array.reduceRight (native)
   at applyExtends (C:\project-root\node_modules\eslint\lib\config\config-file.js:338:28)

/cc @MartinStava @dostalleos

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Mar 22, 2016
@platinumazure platinumazure added bug ESLint is working incorrectly core Relates to ESLint's core APIs and features evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Mar 22, 2016
@ilyavolodin
Copy link
Member

Looks like regex for normalizing config names isn't doing the right thing

@platinumazure platinumazure added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Mar 22, 2016
@nzakas
Copy link
Member

nzakas commented Mar 22, 2016

Might be related to or the same as #5468.

@nzakas
Copy link
Member

nzakas commented Mar 22, 2016

Also possibly related #5175

@ilyavolodin
Copy link
Member

I think this is a bit different then those two issues. I'm thinking that way based on this line: ``Cannot find module '@strv\javascript\standard\optional.js/eslint-config'` it looks like normalized name is not formatted correctly, so I'm guessing that RegEx didn't parse it properly.

@nzakas
Copy link
Member

nzakas commented Mar 28, 2016

Working on this.

@nzakas nzakas self-assigned this Mar 28, 2016
ilyavolodin added a commit that referenced this issue Mar 28, 2016
Fix: Windows scoped package configs (fixes #5644)
@dostalleos
Copy link

Hello,

I just updated to the latest version (2.5.3) and it's still same.

@robertrossmann
Copy link
Contributor Author

I don't think this is released yet, 2.5.3 went out before this was merged. I am assuming the fix for this issue will be available as 2.5.4 or 2.6.

@nzakas
Copy link
Member

nzakas commented Mar 30, 2016

Yes, this fix hasn't been released yet.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features
Projects
None yet
Development

No branches or pull requests

6 participants