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

Configuration for rule "prefer-regex-literals" is invalid #2545

Closed
frontendplace opened this issue Jan 24, 2022 · 7 comments
Closed

Configuration for rule "prefer-regex-literals" is invalid #2545

frontendplace opened this issue Jan 24, 2022 · 7 comments

Comments

@frontendplace
Copy link

I still get this error for the rule in the eslint-config-airbnb-base\rules\best-practices.js

Configuration for rule "prefer-regex-literals" is invalid:
Value [{"disallowRedundantWrapping":true}] should NOT have more than 0 items.

When I run it with eslint directly I don't get the error but when I run this with eslint through gulp-eslint then I get this error.
Does this mean the gulp-eslint version is too old or is this an error in the airbnb base settings?

using:
"eslint": "^8.2.0",
"eslint-config-airbnb-base": "^15.0.0",
"gulp-eslint": "^6.0.0"

@ljharb
Copy link
Collaborator

ljharb commented Jan 24, 2022

You’re using too old an eslint version. Run npm ls to see if your dep graph is invalid.

@frontendplace
Copy link
Author

"eslint": "^8.7.0", if I use this latest version I get the same error

@ljharb
Copy link
Collaborator

ljharb commented Jan 24, 2022

Then it's gulp-eslint. As you can see here: https://unpkg.com/browse/gulp-eslint@6.0.0/package.json gulp-eslint is broken. It should be listing eslint as a peer dep ONLY, but it lists it as a regular dep, and it's using v6, which is ancient.

I can't recommend strongly enough that you ditch gulp entirely.

@ljharb ljharb closed this as completed Jan 24, 2022
@frontendplace
Copy link
Author

frontendplace commented Jan 24, 2022

thanks. yes looking at the dependency tree it still uses version eslint 6.8 and not updated since 3 years. There is a new version called "gulp-eslint-new" :-)

@ljharb
Copy link
Collaborator

ljharb commented Jan 24, 2022

(-‸ლ) for your own sake, please ditch gulp and just invoke eslint using npm run-scripts :-)

@yashwanthvelupula

This comment was marked as spam.

@wallace-sf
Copy link

My eslint version é current latest: 8.12.0.

To fix it i just added to eslint rules the following:

"prefer-regex-literals": [
      "error",
      {
        "disallowRedundantWrapping": true
      }
]

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

4 participants