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

no-useless-escape false positive on closing bracket #12340

Closed
dbolton opened this issue Sep 29, 2019 · 2 comments
Closed

no-useless-escape false positive on closing bracket #12340

dbolton opened this issue Sep 29, 2019 · 2 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules

Comments

@dbolton
Copy link

dbolton commented Sep 29, 2019

Tell us about your environment

  • ESLint Version:
  • Node Version: v10.16.3
  • npm Version: 6.9.0

What parser (default, Babel-ESLint, etc.) are you using? linter-js-standard for Atom also the command line npx standard

Please show your full configuration:

Configuration

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

var test = /[\][]/

What did you expect to happen?
No errors

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

Unnecessary escape character: \].

If I remove the escape character, I get a very different result in JavaScript. For example,

'x][x'.replace(/[\][]+/, '') === 'xx'
'x][x'.replace(/[][]+/, '') === 'x][x'

Are you willing to submit a pull request to fix this bug?
No

Related bugs

@dbolton dbolton added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Sep 29, 2019
@platinumazure
Copy link
Member

Hi @dbolton, thanks for the issue.

I can't reproduce in the online demo.

Could you please let me know if I'm missing a key piece of configuration, and/or share more details about your configuration to help narrow down the problem? Thanks!

@platinumazure platinumazure added evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Sep 29, 2019
@dbolton
Copy link
Author

dbolton commented Sep 29, 2019

Now I can't reproduce either.

@dbolton dbolton closed this as completed Sep 29, 2019
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Mar 29, 2020
@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 Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

2 participants