Skip to content

Javascript regular expression literal not recognized after comparison operator #1170

@cheuer

Description

@cheuer

Our coding style enforces strict comparisons with the literal preceding the variable/function to check. Here is part of a function that checks for numeric input:
if( true === /^\d*\.?\d*$/.test( input ) ) return true;

PHPCS does not recognize the regular expression literal when tokenizing the above code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions