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

SublimeLinter error since v16.0.0 #557

Closed
pat841 opened this issue Feb 15, 2020 · 6 comments
Closed

SublimeLinter error since v16.0.0 #557

pat841 opened this issue Feb 15, 2020 · 6 comments

Comments

@pat841
Copy link
Contributor

pat841 commented Feb 15, 2020

Linting with v15.0.1:

  • Command Line: No issue, runs without error
  • SublimeLinter: No issue, runs without error

Linting with v16.0.0 and after (I have tried every version since):

  • Command Line: No issue, runs without error
  • SublimeLinter: SublimeLinter: ERROR: SyntaxError: Failed to load plugin 'unicorn'

Exact error output:

SublimeLinter: #1 eslint some-file-name.js ERROR:
======================================

SyntaxError: Failed to load plugin 'unicorn' declared in '.eslintrc.json » ./configurations/eslint/.eslintrc.json': Invalid regular expression: /(?<before>(?:^|[^\\])(?:\\\\)*)\\(?<data>x[\da-f]{2}|u[\da-f]{4}|u{[\da-f]+})/: Invalid group
    at Object.<anonymous> (<project-path>/node_modules/eslint-plugin-unicorn/rules/escape-case.js:10:29)
    at Module._compile (<project-path>/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (<project-path>/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at module.exports (<project-path>/node_modules/import-modules/index.js:47:29)
    at Object.<anonymous> (<project-path>/node_modules/eslint-plugin-unicorn/index.js:6:9)

Currently working around this by using v15.0.0.

@sindresorhus
Copy link
Owner

You need to upgrade your Node.js version.

@pat841
Copy link
Contributor Author

pat841 commented Feb 15, 2020

@sindresorhus

node -v
v10.18.1

@sindresorhus
Copy link
Owner

SublimeLinter doesn't necessarily use the Node.js version in your $PATH.

http://www.sublimelinter.com/en/stable/troubleshooting.html

Tests are passing here, so this is not a bug in eslint-plugin-unicorn.

@pat841
Copy link
Contributor Author

pat841 commented Feb 15, 2020

@sindresorhus I dont think its an issue with $PATH since v15 works but v16 doesnt.

@pat841
Copy link
Contributor Author

pat841 commented Feb 15, 2020

I also tried adding "env": { "PATH":"/usr/local/bin/" } which did not fix the issue.

@kanadgupta
Copy link

kanadgupta commented Feb 26, 2020

I'm seeing this issue as well. It's causing SublimeLinter to completely break for me. I believe it has to do with the changes to these regular expressions in #513 and #534 by @fisker:

const escapeWithLowercase = /(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+})/;
const escapePatternWithLowercase = /(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+}|c[a-z])/;

It looks like these changes may have introduced incompatibility issues with their usage of positive lookbehinds and named capturing groups: https://regexr.com/4v5r7

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

No branches or pull requests

3 participants