Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

'Global ESLint/.eslintrc Path' does not seem to be applied on Windows #1354

Open
3 tasks done
cyqsimon opened this issue May 19, 2020 · 0 comments
Open
3 tasks done
Labels

Comments

@cyqsimon
Copy link

cyqsimon commented May 19, 2020

Issue Type

Bug

Issue Description

I installed ESLint globally and enabled the 'Global ESLint/Use global ESLint installation' checkbox. There is no local ESLint installed. Configuration looks like this:

Screencap-001-20200519-163609

When '.eslintrc Path' is /.eslintrc.js as shown in the image, the config file is able to load correctly. C:/.eslintrc.js and C:\.eslintrc.js works as well.

However it seems to have trouble when the file is inside a subdirectory. If I put the config file in C:/Config/ and set the path as /Config/.eslintrc.js, the config file is no longer loaded. Neither do C:/Config/.eslintrc.js nor C:\Config\.eslintrc.js work.

Strangely, if you leave .eslintrc.js under C:\.eslintrc.js, and set the path as anything else (e.g. /Config/.eslintrc.js, C:\.eslintrc.js is still loaded. This is leading me to suspect that the option 'Global ESLint/.eslintrc Path' is not applied at all, and hard-coded /.eslintrc.js is being applied regardless.

Bug Checklist

  • Restart Atom
  • N/A Verify the eslint CLI gives the proper result, while linter-eslint does not
  • Paste the output of the Linter Eslint: Debug command from the Command Palette below

Linter Eslint: Debug output:

When C:/.eslintrc.js exists and path is /.eslintrc.js:

Atom version: 1.46.0
linter-eslint version: 8.5.5
ESLint version: 6.8.0
Hours since last Atom restart: 0
Platform: win32
Using global ESLint from: C:\Users\XXXXX\AppData\Roaming\npm\node_modules\eslint
Current file's scopes: [
  "source.js",
  "string.quoted.double.js"
]
linter-eslint configuration: {
  "disabling": {
    "disableWhenNoEslintConfig": true,
    "rulesToSilenceWhileTyping": []
  },
  "global": {
    "eslintrcPath": "/.eslintrc.js",
    "useGlobalEslint": true,
    "globalNodePath": ""
  },
  "scopes": [
    "source.js",
    "source.jsx",
    "source.js.jsx",
    "source.flow",
    "source.babel",
    "source.js-semantic"
  ],
  "lintHtmlFiles": false,
  "autofix": {
    "fixOnSave": false,
    "ignoreFixableRulesWhileTyping": false,
    "rulesToDisableWhileFixing": []
  },
  "advanced": {
    "disableEslintIgnore": false,
    "disableFSCache": false,
    "showRuleIdInMessage": true,
    "eslintRulesDirs": [],
    "localNodeModules": ""
  }
}

When C:/.eslintrc.js exists and path is /Config/.eslintrc.js:

Same as above

When C:/.eslintrc.js does not exist and path is /Config/.eslintrc.js:

Command errors on execution:
Screencap-001-20200519-165411

@UziTech UziTech added the bug label Mar 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants