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

v6.6.0 of eslint will not run from plugin #1306

Closed
3 tasks done
rastating opened this issue Nov 4, 2019 · 5 comments
Closed
3 tasks done

v6.6.0 of eslint will not run from plugin #1306

rastating opened this issue Nov 4, 2019 · 5 comments

Comments

@rastating
Copy link

Issue Type

Bug

Issue Description

When using v6.6.0 of eslint, linter-eslint fails with the message Invalid regular expression flags

Bug Checklist

  • Restart Atom
  • 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
Atom version: 1.36.1
linter-eslint version: 8.5.5
ESLint version: 6.6.0
Hours since last Atom restart: 0.1
Platform: linux
Using local project ESLint from: *project path redacted*/node_modules/eslint
Current file's scopes: [
  "source.js"
]
linter-eslint configuration: {
  "disabling": {
    "disableWhenNoEslintConfig": false,
    "rulesToSilenceWhileTyping": []
  },
  "global": {
    "eslintrcPath": ".eslintrc.json",
    "useGlobalEslint": false,
    "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": ""
  }
}
@zypA13510
Copy link

I have a similar (but maybe different) issue, eslint@6.6.0 will throw an error whereas eslint@6.5.1 will not.

The error reads:

Error while running ESLint: /path/.eslintrc.yml:.
/path/.eslintrc.yml:
    Configuration for rule "array-element-newline" is invalid:
    Value "consistent" should be equal to one of the allowed values.
    Value "consistent" should be object.
    Value "consistent" should match exactly one schema in oneOf.

while sometimes the following error appears instead:

Error while running ESLint: /path/.eslintrc.yml:.
/path/.eslintrc.yml:
    Configuration for rule "new-parens" is invalid:
    Value ["always"] should NOT have more than 0 items.

To my understanding, new-parens: always was added in eslint@6.0.0-alpha.2 (eslint/eslint#11379), while array-element-newline: consistent was added in eslint@5.0.0-alpha.4 (eslint/eslint#10355). The above errors seem to indicate that linter-eslint has fallen back to use the built-in eslint@4.19.1 instead of locally installed eslint@6.6.0.

Output of Linter Eslint: Debug
Atom version: 1.38.2
linter-eslint version: 8.5.5
ESLint version: 6.6.0
Hours since last Atom restart: 0.3
Platform: linux
Using local project ESLint from: /path/node_modules/eslint
Current file's scopes: [
  "source.js"
]
linter-eslint configuration: {
  "advanced": {
    "disableEslintIgnore": false,
    "disableFSCache": false,
    "showRuleIdInMessage": true,
    "eslintRulesDirs": [],
    "localNodeModules": ""
  },
  "disabling": {
    "rulesToSilenceWhileTyping": [
      "eol-last",
      "linebreak-style",
      "no-trailing-spaces"
    ],
    "disableWhenNoEslintConfig": true
  },
  "global": {
    "useGlobalEslint": false,
    "eslintrcPath": "",
    "globalNodePath": ""
  },
  "scopes": [
    "source.js",
    "source.jsx",
    "source.js.jsx",
    "source.flow",
    "source.babel",
    "source.js-semantic"
  ],
  "lintHtmlFiles": false,
  "autofix": {
    "fixOnSave": false,
    "ignoreFixableRulesWhileTyping": false,
    "rulesToDisableWhileFixing": []
  }
}

@eakl
Copy link

eakl commented Nov 18, 2019

Similar problem here. ESLint doesn't run from plugin in Atom. Creating any *.js file trigger the error.

Configuration:

  • Atom Version: 1.38.2
  • Node Version: 12.13.0
  • npm Version: 6.12.0
  • ESLint Version: 6.6.0
  • linter-eslint Version: 8.5.5

Error:

Error while running ESLint: Invalid regular expression flags
Invalid regular expression flags
Referenced from: /Users/me/dev/.eslintrc.yml

/Users/me/dev/node_modules/eslint/lib/source-code/source-code.js:426
return /\s/u.test(text.replace(/\/\*.*?\*\//gus, ""));
                               ^

@Arcanemagus
Copy link
Member

ESLint v6 dropped support for Node.js v6, I notice that all of you that have reported an Atom version are on an older version that would be using Node.js v8.9.3 (or older!). It's quite possible that ESLint put in something that actually requires a newer version of Node.js than that, can you try updating to the current version of Atom (v1.41.0) which includes Node.js v10.11.0 and see if that solves your problem?

@zypA13510
Copy link

zypA13510 commented Nov 19, 2019

@Arcanemagus I don't think this has anything to do with nodejs version (eslint v6.5.1 works just fine, see my comment above, and the change you mentioned was added way back at v6.0.0-alpha)

I tried to debug this issue the other day, but I can't find a way to inspect the worker.js and set breakpoints in there. Any idea?

Update: upgrading atom to 1.41.0 does solve my issue (although it has other issues for me). I have no word.

@rastating
Copy link
Author

ESLint v6 dropped support for Node.js v6, I notice that all of you that have reported an Atom version are on an older version that would be using Node.js v8.9.3 (or older!). It's quite possible that ESLint put in something that actually requires a newer version of Node.js than that, can you try updating to the current version of Atom (v1.41.0) which includes Node.js v10.11.0 and see if that solves your problem?

I have just updated to v1.41.0 and can confirm it fixes the issue. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants