Skip to content

Fix extraction from template literal/function with array - #7481

Merged
thecrypticace merged 10 commits into
tailwindlabs:masterfrom
SamuelAlev:fix/literal-template-and-array-extractor
Mar 1, 2022
Merged

thecrypticace merged 10 commits into
tailwindlabs:masterfrom
SamuelAlev:fix/literal-template-and-array-extractor

Conversation

@SamuelAlev

@SamuelAlev SamuelAlev commented Feb 15, 2022 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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