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

Support member access on function calls #218

Merged
merged 4 commits into from Oct 3, 2023

Conversation

thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Oct 3, 2023

We support member access for tagged template literals when you specify custom sortable functions.

For example — the following:

module.exports = {
  tailwindFunctions: ['tw'],
}

Can sort these:

const a = tw`sm:p-1 p-2`
const b = tw.foo`sm:p-1 p-2`
const c = tw.foo.bar`sm:p-1 p-2`

This PR adds support for function calls / CallExpression so it works in this case too:

const a = tw("sm:p-1 p-2")
const b = tw.foo("sm:p-1 p-2")
const c = tw.foo.bar("sm:p-1 p-2")

@thecrypticace thecrypticace merged commit 047d591 into main Oct 3, 2023
1 check passed
@thecrypticace thecrypticace deleted the fix/member-access-call-expressions branch October 3, 2023 17:24
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.

None yet

1 participant