question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

no-useless-escapes has false positives for periods and meta sequences.

See original GitHub issue

Tell us about your environment

  • ESLint Version: 4.10.0
  • Node Version: 9.0.0
  • npm Version: 5.5.1

What parser (default, Babel-ESLint, etc.) are you using? default Please show your full configuration:

Configuration
{
	"env": {
		"es6": true,
		"node": true
	},
	"extends": "eslint:recommended",
	"rules": {
		"indent": [2, "tab"],
		"linebreak-style": [2, "unix"],
		"quotes": [2, "double"],
		"semi": [2, "always"]
	},
	"parserOptions": {
		"sourceType": "module",
		"ecmaVersion": 2017
	}
}

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

this.regexes = {
	suffix: new RegExp("^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?(" + this.suffixes.join("|") + ")?$", "i"),
	suffix_strict: new RegExp("^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?(" + this.suffixes.join("|") + ")$", "i")
};
eslint src/**

What did you expect to happen? It wouldn’t complain about correct regex. What actually happened? Please include the actual, raw output from ESLint. It claimed the escapes were useless when they were needed.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
LJNeoncommented, Nov 2, 2017
   9:26  error  Unnecessary escape character: \d  no-useless-escape
   9:30  error  Unnecessary escape character: \.  no-useless-escape
   9:32  error  Unnecessary escape character: \d  no-useless-escape
   9:38  error  Unnecessary escape character: \.  no-useless-escape
   9:40  error  Unnecessary escape character: \d  no-useless-escape
   9:51  error  Unnecessary escape character: \d  no-useless-escape
  10:33  error  Unnecessary escape character: \d  no-useless-escape
  10:37  error  Unnecessary escape character: \.  no-useless-escape
  10:39  error  Unnecessary escape character: \d  no-useless-escape
  10:45  error  Unnecessary escape character: \.  no-useless-escape
  10:47  error  Unnecessary escape character: \d  no-useless-escape
  10:58  error  Unnecessary escape character: \d  no-useless-escape

here’s the actual eslint output lmao, mixed up the two issues I opened.

0reactions
LJNeoncommented, Nov 2, 2017

and yeah that was the problem, thanks for clarifying.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The uterine blush. A potential false-positive in Meckel's ...
It is a manifestation of a normal physiologic phenomenon, and must be recognized to prevent false-positive Meckel's scan interpretations.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found