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 is missing \B regex escape #5750

Closed
platinumazure opened this issue Mar 31, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@platinumazure
Copy link
Member

commented Mar 31, 2016

What version of ESLint are you using?

2.5.3

What parser (default, Babel-ESLint, etc.) are you using?

default

Please show your full configuration:

{
    "rules": {
        "no-useless-escape": "error"
    }
}

What did you do? Please include the actual source code causing the issue.

var regex = /.\B./;

What did you expect to happen?

No error-- \B is a valid regex escape, meaning the inverse of \b (that is, \B is a zero-width assertion that the characters on either side are both in \w or both in \W).

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

The character was noted as a supposedly "invalid" escape.


I went through MDN and found no other missing escapes, so it's just \B. This is an assertion production in the ECMAScript standard.

@eslintbot eslintbot added the triage label Mar 31, 2016

@platinumazure platinumazure added bug rule evaluating and removed triage labels Mar 31, 2016

@platinumazure platinumazure changed the title no-useless-escape is missing some valid regex escapes no-useless-escape is missing \B regex escape Mar 31, 2016

@mysticatea mysticatea added accepted and removed evaluating labels Apr 1, 2016

@mysticatea

This comment has been minimized.

Copy link
Member

commented Apr 1, 2016

image
image

onurtemizkan added a commit to onurtemizkan/eslint that referenced this issue Apr 1, 2016

ilyavolodin added a commit that referenced this issue Apr 1, 2016

Merge pull request #5755 from onurtemizkan/no-useless-escape/adding-B…
…-escape

Fix: no-useless-escape \B regex escape (fixes #5750)

@eslint eslint bot locked and limited conversation to collaborators Feb 6, 2018

@eslint eslint bot added the archived due to age label Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.