Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cunisia opened this issue Dec 20, 2021 · 2 comments
Open

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

cunisia opened this issue Dec 20, 2021 · 2 comments

Comments

@cunisia
Copy link

cunisia commented Dec 20, 2021

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

@gmullerb
Copy link
Owner

Thank You! I'm Happy that you find this plugin Super Useful! ✨ 🎉

I will look to see if this is possible and do an improvement (but if it is in the VS Code side it will be "out" of my hands)

@allanpaiste
Copy link

allanpaiste commented Dec 19, 2022

Can chip in on this one as well where it seems that only the first matched AST token is highlighted, so you get:

Code: // This is a @hello/world example

  • pattern: world => world gets highlighted
  • pattern: hello/world => only hello gets highlighted
  • pattern: @hello/world => only @ gets highlighted

PS: very useful plugin :) Especially now with synonym rules :3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants