Skip to content

feat(no-unsafe-enum-assignment): add rule - #1316

Merged
camc314 merged 6 commits into
mainfrom
codex/no-unsafe-enum-assignment
Oct 22, 2026
Merged

camc314 merged 6 commits into
mainfrom
codex/no-unsafe-enum-assignment

Conversation

@camc314

@camc314 camc314 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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 implements contracts.

Imports every case from packages/eslint-plugin/tests/rules/no-unsafe-enum-assignment.test.ts on 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.

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`
Copilot AI balanced review requested due to automatic review settings October 21, 2026 22:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-22T18:20:28.546719Z 509a38b New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

@camc314
camc314 merged commit 62e97c9 into main Oct 22, 2026
8 checks passed
@camc314
camc314 deleted the codex/no-unsafe-enum-assignment branch October 22, 2026 23:16
graphite-app Bot pushed a commit to oxc-project/oxc that referenced this pull request Oct 23, 2026
…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.
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