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

Fix extraction from template literal/function with array #7481

Merged
merged 10 commits into from
Mar 1, 2022
Merged

Fix extraction from template literal/function with array #7481

merged 10 commits into from
Mar 1, 2022

Conversation

SamuelAlev
Copy link
Contributor

@SamuelAlev SamuelAlev commented Feb 15, 2022

Fixes the bug from #7413

The extraction couldn't get those cases:

  • <div className={`${['pr-1.5'].join(' ')}`}><div> (template, normal class, single quotes)
  • <div className={`${["pr-1.5"].join(' ')}`}><div> (template, normal class, double quotes)
  • <div className={`${['tw-h-[100px]'].join(' ')}`}><div> (template, dynamic class, single quotes)
  • <div className={`${["tw-h-[100px]"].join(' ')}`}><div> (template, dynamic class, double quotes)
  • document.body.classList.add(['pr-1.5'].join(" ")); (function, normal class, single quotes)
  • document.body.classList.add(["pr-1.5"].join(" ")); (function, normal class, double quotes)
  • document.body.classList.add(['tw-h-[100px]'].join(" ")); (function, dynamic class, single quotes)
  • document.body.classList.add(["tw-h-[100px]"].join(" ")); (function, dynamic class, double quotes)

@SamuelAlev SamuelAlev changed the title fix: allow extraction from template literal with array Fix extraction from template literal/function with array Feb 15, 2022
@thecrypticace thecrypticace self-assigned this Mar 1, 2022
@thecrypticace thecrypticace merged commit bc46d0e into tailwindlabs:master Mar 1, 2022
@thecrypticace
Copy link
Contributor

Thanks for the fix and writing the tests! 🙌

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

Successfully merging this pull request may close these issues.

2 participants