Hugo TH
Hugo TH

Reputation: 11

ESLint SyntaxError: Invalid regular expression flags, Regex

I tried to install Eslint extension plugin on my React App project, it appears that the EsLint Server stopped because I have an issue on the no-octal-escape.js file

const match = node.raw.match(/^(?:[^\\]|\\.)*?\\([0-3][0-7]{1,2}|[4-7][0-7]|0(?=[89])|[1-7])/su)

Node version : 12.13.1 Eslint version : 6.5.1

Can't figure it out

Console output

Upvotes: 1

Views: 1349

Answers (2)

Hugo TH
Hugo TH

Reputation: 11

The problem was solved by running VSCode updates. Seems to be issue between Eslint extension and VsCode older versions.

Upvotes: 0

Gabriel Muniz
Gabriel Muniz

Reputation: 11

The fix for me came by using nvm in order to make sure I was actually using the last version by using the following command:

$ nvm install stable

I just ran into the exact same problem with my VueJS App project.

Even though I had an up to date node version, it turned out that I was not, in fact, using it. Which seems to be quite common: https://github.com/eslint/eslint/issues/12538

Upvotes: 1

Related Questions