The tagged template support from #41 only supported the very basic tag`...` format, but not formats such as tag.div`...` or tag(Component)`...`. This reads the object and callee of the tag to process those as well.
Libraries such as twc and twin.micro use this pattern.
Fixes #272
Node Support
I used Optional Chaining and the Nullish coalescing operator - these are only supported in Node 14.0.0 and higher, so I bumped the engines field.
Node 12 is EoL for over 2 years, but I can update it to alternative syntax if you like.
Type of change
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
How Has This Been Tested?
Test cases added. I also added missing template tag tests for all the rules.
Test Configuration:
OS + version: macOS Sonoma 14.2.1
NPM version: 9.8.1
Node version: 20.6.1
Checklist:
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation Note that this does not change anything, but tagged template documentation was already missing and is available here: #288
[x] My changes generate no new warnings
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
[ ] Any dependent changes have been merged and published in downstream modules
[x] I have checked my code and corrected any misspellings
fix: support tag.div`` and tag(Component)``
Description
The tagged template support from #41 only supported the very basic
tag`...`
format, but not formats such astag.div`...`
ortag(Component)`...`
. This reads the object and callee of the tag to process those as well.Libraries such as twc and twin.micro use this pattern.
Fixes #272
Node Support
I used Optional Chaining and the Nullish coalescing operator - these are only supported in Node 14.0.0 and higher, so I bumped the
engines
field.Node 12 is EoL for over 2 years, but I can update it to alternative syntax if you like.
Type of change
How Has This Been Tested?
Test cases added. I also added missing template tag tests for all the rules.
Test Configuration:
Checklist:
I have commented my code, particularly in hard-to-understand areasI have made corresponding changes to the documentationNote that this does not change anything, but tagged template documentation was already missing and is available here: #288Any dependent changes have been merged and published in downstream modules