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

Supporting tagged string literals like twbg-blue-500 #64

Open
rik-iso opened this issue Jan 6, 2025 · 2 comments · May be fixed by #65
Open

Supporting tagged string literals like twbg-blue-500 #64

rik-iso opened this issue Jan 6, 2025 · 2 comments · May be fixed by #65
Labels
feature request New feature or request

Comments

@rik-iso
Copy link

rik-iso commented Jan 6, 2025

As far as I can tell, extending the config like this:

  callees: [
    ...getDefaultCallees(),
    [
      'tw',
      [
        {
          match: MatcherType.String,
        },
      ],
    ],
  ],

only works for

tw(`...`)

but not tags like

tw`...`

which we are using.
The tailwindcss eslint plugin supports this with a tags option.

There might be a way to get this to work via regex but I wasn't able to yet.

@schoero schoero added the feature request New feature or request label Jan 7, 2025
@schoero
Copy link
Owner

schoero commented Jan 7, 2025

Regular expressions could work for tagged template literals only when they’re assigned to variables, not when they stand alone.

I think the best way is to add a tags option as well.

I will look into it.

@schoero schoero linked a pull request Jan 8, 2025 that will close this issue
@schoero
Copy link
Owner

schoero commented Jan 9, 2025

Are you using a public utility that works with template literal tags @rik-iso ? If so, I would like to add it to the default options if it is popular enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants