Conversation
🦋 Changeset detectedLatest commit: 1000693 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
3bc0ab5 to
8b557be
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR improves error handling for non-JavaScript identifiers by moving validation from individual parsers to a centralized location. The validation now happens during semantic checking and type definition generation, providing better error messages and preventing invalid identifiers from being processed.
- Moves non-JS identifier validation from individual parsers (rule, keyframe, at-value) to the checker and DTS creator
- Updates error message from "non-JavaScript identifier" to "invalid names as JavaScript identifiers"
- Consolidates validation logic using a new
isValidAsJSIdentifierutility function
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/util.ts | Adds isValidAsJSIdentifier utility function to centralize validation logic |
| packages/core/src/checker.ts | Implements validation checks for local tokens and imported values with improved error messages |
| packages/core/src/dts-creator.ts | Filters out invalid identifiers during type definition generation |
| packages/core/src/parser/*.ts | Removes individual validation logic from parsers |
| packages/ts-plugin/e2e/feature/*.test.ts | Updates tests to reflect validation moved from syntactic to semantic phase |
| packages/core/src/parser/*.test.ts | Removes test cases that are no longer applicable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
follow-up: #220