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

Module '"tailwind-merge"' declares 'ClassValidator' locally, but it is not exported. #331

Closed
xsjcTony opened this issue Oct 29, 2023 · 4 comments · Fixed by #348
Closed
Labels
context-v2 Related to tailwind-merge v2 feature Is new feature

Comments

@xsjcTony
Copy link

Describe the bug

ClassValidator type is exported in source code, but not in the dist build dts file

To Reproduce

import type { ClassValidator } from 'tailwind-merge';

Expected behavior

It should export

Environment

  • tailwind-merge version: latest (v2.0.0)

Additional context

@dcastil
Copy link
Owner

dcastil commented Oct 30, 2023

Hey @xsjcTony! 👋

The ClassValidator type is used internally but it isn't exported from the package. You can see all the package exports here: https://github.com/dcastil/tailwind-merge/blob/v2.0.0/src/index.ts

The type is really simple and you can recreate it in your own codebase if you want:

type ClassValidator = (classPart: string) => boolean

@dcastil dcastil added the context-v2 Related to tailwind-merge v2 label Oct 30, 2023
@xsjcTony
Copy link
Author

Yep that's true. But

  1. It's a bit weird that the type is exported in the source code but not in the build file
  2. I'd still prefer relying on types exported from the package instead of defining my own, although it's simple but I won't know if one day it changed

@dcastil
Copy link
Owner

dcastil commented Oct 30, 2023

That makes sense, although that would of course only happen in a major release. I'll add the type to the library exports in the next release.

Copy link

github-actions bot commented Dec 2, 2023

This was addressed in release v2.1.0.

@dcastil dcastil added feature Is new feature and removed feature request labels Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context-v2 Related to tailwind-merge v2 feature Is new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants