Skip to content

Infinite loop with "no-useless-escape" rule #8

@ota-meshi

Description

@ota-meshi

I have confirmed with eslint4b v7.20.0.

The following source code is the source code for at 25,907 line of the eslint4b/dist/core-rules.js file causing the infinite loop.

        while (match = /\\[^\d]/gu.exec(value)) {
          validateString(node, match);
        }

In the original source code, the regular expression correctly uses one instance, so it doesn't go into an infinite loop.

https://github.com/eslint/eslint/blob/87c43a5d7ea2018cffd6d9b5c431ecb60caaf0d6/lib/rules/no-useless-escape.js#L210-L215

                const pattern = /\\[^\d]/gu;
                let match;

                while ((match = pattern.exec(value))) {
                    validateString(node, match);
                }

I think it's probably a build system bug, but I opened an issue here because I don't know which build system is wrong.

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