Skip to content

Incorrect highlighting of RegExp literal with / in character class #14

Open
@kevinoid

Description

@kevinoid

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions