Skip to content

Errors / warnings raised by regex are hard to spot in VS Code #14

@cunisia

Description

@cunisia

Hi there,

First of all thank you very much for this plugin that is super useful !

It's a tiny issue that I'm posting but if there is a quick fix that'd be super awesome : in VS Code, when a string matches one of the regexps used an eslint rule, only its first character is underlined :

Example:

Given this rule:

{
      regex: 'querySql\\([^,]+,[^,]+\\)',
      message: 'Pass a third argument containing query variables.',
}

This code snipet matches, but only its first char q is underlined:

const response = await querySql(prisma, query)

image

The behavior I'd expect would be to underline the whole string matching the regexp (ie: querySql(prisma, query))

I searched the doc for a way to fix that in the rule configuration and tried to wrap the regex between parenthesis but no luck. If I missed something please accept my apologies and point me to the right piece of documentation :)

Thanks in advance,
Pierre

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