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
Fix: Add support for tagged template literal generics in no-unexpected-multiline #11698
Fix: Add support for tagged template literal generics in no-unexpected-multiline #11698
Conversation
Thank you for this PR. I don't intend to block this PR, but maybe ESTree should be updated because TaggedTemplateExpression doesn't have type annotation. (Or Would you change the commit message to follow our contributing guide? |
@mysticatea Do you have concerns with merging this PR even if ESTree isn't updated? |
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, thanks!
Related discussion is here: typescript-eslint/typescript-eslint#510 I'm happy if we can review based on the AST spec. |
I think I'm with @mysticatea here. You are using a property that is not part of the official spec, and while it doesn't hurt anyone, it makes it harder for others to contribute to this rule later. I would want to find some other way to support this feature, without undocumented properties. |
Agree with @ilyavolodin that we should try to avoid using undocumented properties. I would be in favor of a PR that doesn't use TS-specific node properties.
The TSC discussed this. I came up with this suggestion for an alternative approach-- no idea if it will work, but worth a try maybe?
@bradzacher If you happen to get back to this-- could you please try that approach and see if it could be made to work? Then that would let us avoid mentioning TS-specific node type or node properties and it would hopefully also work for the Typescript use case. Thanks! |
updated as requested |
Thanks for the update, @bradzacher! Now that this doesn't use undocumented node properties, I'll mark it as accepted and give the team a chance to look it over. |
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.
Looks good to me. Thanks for contributing!
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. Thanks for updating it!
What is the purpose of this pull request? (put an "X" next to item)
#11650
What changes did you make? (Give an overview)
Adds support for multiline tagged template expressions with generics (typescript only)
I thought that because this change was so simple, and it is a no-op for non-ts code, it might be a good fit to fix upstream instead of creating a new rule in the typescript plugin.
Don't be afraid to reject if you don't think it fits.