Skip to content

Conversation

@mizdra
Copy link
Owner

@mizdra mizdra commented Jan 29, 2026

I refactored the code in preparation for resolving #323.

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.
@mizdra mizdra added the Type: Other Cannot be classified into any other type. label Jan 29, 2026
@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2026

⚠️ No Changeset found

Latest commit: 264cfb7

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

Extract duplicated token name validation logic from checker.ts and
dts-generator.ts into a shared `validateTokenName` function in util.ts.
This consolidates the validation rules for invalid JS identifiers,
`__proto__`, and `default` (when namedExports is enabled) into one place.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mizdra mizdra marked this pull request as ready for review January 29, 2026 16:34
@mizdra mizdra merged commit c269562 into main Jan 29, 2026
18 checks passed
@mizdra mizdra deleted the refactor-code branch January 29, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Other Cannot be classified into any other type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants