Skip to content

Conversation

@mizdra
Copy link
Owner

@mizdra mizdra commented Jan 28, 2026

This Pull Request is still incomplete.

CSS Modules Kit currently does not allow tokens with names that are invalid as JS identifiers. However, it may allow them in the future, but only when `cmkOptions.namedExport` is set to `false`.

We will refactor to ensure tests do not break when this change is implemented.
@changeset-bot
Copy link

changeset-bot bot commented Jan 28, 2026

⚠️ No Changeset found

Latest commit: 3d6af46

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mizdra mizdra force-pushed the support-non-js-ident-token branch from a1ebb44 to 3d6af46 Compare January 28, 2026 15:42
for (const token of cssModule.localTokens) {
// Reject special names as they may break .d.ts files
if (!isValidAsJSIdentifier(token.name)) {
if (config.namedExports && !isValidAsJSIdentifier(token.name)) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is probably not advisable to permit all characters allowed in CSS class names. foo\' and bar\\ are good examples. Both will break .d.ts files.

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