Skip to content

fix(lint/no-duplicate-type-constituents): report constituents with identical syntax - #1214

Merged
camc314 merged 1 commit into
mainfrom
fix/lint-no-duplicate-type-constituents-1463
Dec 1, 2026
Merged

camc314 merged 1 commit into
mainfrom
fix/lint-no-duplicate-type-constituents-1463

Conversation

@camc314

@camc314 camc314 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Ports oxc-project/tsgolint#1463 (74ffdbf1), including its baseline update.

Each function type or object type literal gets its own anonymous checker type, so the type-identity check never matched copies of the same signature or literal. Like typescript-eslint's isSameAstNode, the rule now compares the syntax of earlier constituents, ignoring parentheses, before it looks at types. The two upstream object-literal cases that were skipped now run.

type T = ((value: string) => void) | ((value: string) => void); // now reported
type U = { a: string } | { a: string }; // now reported

Copilot AI balanced review requested due to automatic review settings December 1, 2026 13:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T13:27:19.717603Z 688ed53 PR opened
ℹ️ 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.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Performance change vs main

Workflow run · main 8a8951516cc3 → PR merge cc7b4532d67d (head 688ed53d23e6)

Clef gate: Running benchmarks because the decision was unavailable (crates/tsrs_lint/src/rules/no_duplicate_type_constituents.rs: patch exceeds the Clef context limit (6015 bytes)).

Release builds in fast mode (TSRS_FAST=1) with Hyperfine 2 hardware counters. After warming each binary, alternating main/PR pairs measure wall time at both the fast preset's default checker count and with --singleThreaded, with ten pairs per configuration by default. Instructions come from the single-threaded runs; peak RSS comes from the default-count runs.
Incremental runs start with fresh build info before every invocation; check runs disable incremental compilation.

Project Mode Single-thread wall time Δ Single-thread instructions Δ Default wall time Δ Default peak RSS Δ
vscode check failed — — —
vscode incremental failed — — —
xstate-main check failed — — —
xstate-main incremental failed — — —
webpack check failed — — —
webpack incremental failed — — —
mui-docs check failed — — —
mui-docs incremental failed — — —
Compiler check failed — — —
Compiler incremental failed — — —
Compiler-Unions check failed — — —
Compiler-Unions incremental failed — — —
cal-diy check failed — — —
cal-diy incremental failed — — —
formbricks-web check failed — — —
formbricks-web incremental failed — — —
supabase-studio check failed — — —
supabase-studio incremental failed — — —
t3code-server check failed — — —
t3code-server incremental failed — — —
mikro-orm check failed — — —
mikro-orm incremental failed — — —
next-packages-next check failed — — —
next-packages-next incremental failed — — —
next-root check failed — — —
next-root incremental failed — — —
storybook check failed — — —
storybook incremental failed — — —
nuxt check failed — — —
nuxt incremental failed — — —
playwright check failed — — —
playwright incremental failed — — —
drizzle-orm check failed — — —
drizzle-orm incremental failed — — —
typeorm check failed — — —
typeorm incremental failed — — —
date-fns check failed — — —
date-fns incremental failed — — —
opencode-core check failed — — —
opencode-core incremental failed — — —
lobehub check failed — — —
lobehub incremental failed — — —
sentry check failed — — —
sentry incremental failed — — —

Negative means the PR used less; positive means it used more. Deltas are medians of paired PR/main ratios for wall time and instructions. Single-threaded runs reduce scheduling noise; shared CI machines can still add noise to wall time.
Measurements missing or invalid on: vscode (check), vscode (incremental), xstate-main (check), xstate-main (incremental), webpack (check), webpack (incremental), mui-docs (check), mui-docs (incremental), Compiler (check), Compiler (incremental), Compiler-Unions (check), Compiler-Unions (incremental), cal-diy (check), cal-diy (incremental), formbricks-web (check), formbricks-web (incremental), supabase-studio (check), supabase-studio (incremental), t3code-server (check), t3code-server (incremental), mikro-orm (check), mikro-orm (incremental), next-packages-next (check), next-packages-next (incremental), next-root (check), next-root (incremental), storybook (check), storybook (incremental), nuxt (check), nuxt (incremental), playwright (check), playwright (incremental), drizzle-orm (check), drizzle-orm (incremental), typeorm (check), typeorm (incremental), date-fns (check), date-fns (incremental), opencode-core (check), opencode-core (incremental), lobehub (check), lobehub (incremental), sentry (check), sentry (incremental). See the workflow run for errors.

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.

🟢 Approval recommended

No active review issues remain for the updated duplicate-type constituent detection.

No open issues 🎉

What changed in this PR

Updates no-duplicate-type-constituents to detect syntactically identical constituents that have distinct checker types, porting upstream tsgolint fix #1463.

Changes:

  • Compares constituent syntax, ignoring parentheses, before checking type identity.
  • Enables object-literal baseline cases and adds function-signature and generic-parameter coverage.
  • Updates the rule’s upstream reference and porting progress.
File Description
crates/​tsrs_lint/​tests/​baselines/​PROGRESS.md Records the updated upstream revision.
crates/​tsrs_lint/​tests/​baselines/​no-duplicate-type-constituents/​REFERENCE Pins the baseline to tsgolint commit 74ffdbf1.
crates/​tsrs_lint/​tests/​baselines/​no-duplicate-type-constituents/​baseline.json Adds and enables cases with expected diagnostics and fixes.
crates/​tsrs_lint/​src/​rules/​no_duplicate_type_constituents.rs Adds recursive syntax comparison and shares duplicate-reporting logic.

Review effort: Balanced

@camc314
camc314 added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit b4f92f7 Dec 1, 2026
21 of 27 checks passed
@camc314
camc314 deleted the fix/lint-no-duplicate-type-constituents-1463 branch December 1, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants