Repository navigation
feat(no-unsafe-enum-assignment): add rule - #1316
Conversation
Changes from typescript-eslint are included in this change - typescript-eslint/typescript-eslint#12732 - typescript-eslint/typescript-eslint#12957 - typescript-eslint/typescript-eslint#13024 This rule's tests are up to date with typescript-eslint `e8899847445ea09ab8ac76605ec47b3a7e83489d`
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 172fa12d7a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…8117) Register `typescript/no-unsafe-enum-assignment` as a type-aware rule backed by oxlint-tsgolint 7.0.2005, following oxc-project/tsgolint#1316. Add rule documentation and regenerate the rule registry, JSON schema, and TypeScript config types. Extend the existing type-aware CLI fixture with unsafe assignments, arguments, returns, assertions, mutations, and enum-key access, plus valid enum-member and bitwise-combination cases. Reuse the existing tests and update their diagnostic and count snapshots.
Adds
no-unsafe-enum-assignment, porting typescript-eslint/typescript-eslint#12732 and the bounded recursive type checks from typescript-eslint/typescript-eslint#12957. The rule checks enum assignments, arguments, returns, assertions, mutations, and mapped keys while allowing bitwise combinations of enum members.Type comparisons and diagnostic formatting are bounded for recursive generics. Comparison traversal tracks depth and generic-member context so earlier deep visits cannot hide shallower mismatches. Static class members check constructor-side superclass types and ignore instance
implementscontracts.Imports every case from
packages/eslint-plugin/tests/rules/no-unsafe-enum-assignment.test.tson upstream main: 124 valid and 132 invalid cases, plus 28 local regression cases. Includes the test updates from typescript-eslint/typescript-eslint#13024.This rule's tests are up to date with typescript-eslint
e8899847445ea09ab8ac76605ec47b3a7e83489d.