vim-es6 icon indicating copy to clipboard operation
vim-es6 copied to clipboard

Incorrect highlighting of RegExp literal with / in character class

Open kevinoid opened this issue 8 years ago • 0 comments

The grammar for RegExp literals in ES6 allows / to appear without a preceding \ in character class expressions (see RegularExpressionClassChar in the grammar). However, vim-es6 highlights such expressions incorrectly. For example, in the following:

/foo[/]bar/

vim-es6 does not highlight ]bar/ as part of the regular expression.

Note that this is made more significant by the the ESLint no-useless-escape rule (which is enabled by popular configurations such as the airbnb config) which produces a warning when \ is added.

Thanks, Kevin

kevinoid avatar Feb 25 '17 06:02 kevinoid