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
Update: Improve report location for template-tag-spacing (refs #12334) #13203
Conversation
Thanks for doing this. For “always”, I think I’d prefer the parens and “foo” all be underlined so it matches what happens without parens. |
This can be done by reporting range from the start to the quasi, which is basically everything that makes the tag in a tagged template literal. Some examples: and a typescript example with generics: Does it look okay, or is it maybe underlining too much code? Another alternative might be to report loc of the left backtick. |
This makes sense to me! |
I still like my suggestion better. :) It’s difficult time see underlines of just one character. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it! @kaicataldo are you okay with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[X] Other, please explain:
refs #12334
Change reported location in the
template-tag-spacing
rule.What changes did you make? (Give an overview)
For
"always"
, the rule will now report the full location of the first token before the template literal, instead of just its start.For
"never"
, the rule will now report range between the first token before the template literal and the template literal, instead of start of the first token before the template literal,"always"
before this change:"always"
after this change:"never"
before this change:"never"
after this change:Is there anything you'd like reviewers to focus on?