Skip to content

fix(lint/no-deprecated): check each union constituent for deprecated properties - #1208

Merged
camc314 merged 1 commit into
mainfrom
fix/lint-no-deprecated-1458
Dec 1, 2026
Merged

camc314 merged 1 commit into
mainfrom
fix/lint-no-deprecated-1458

Conversation

@camc314

@camc314 camc314 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Ports oxc-project/tsgolint#1458 (56028945), including its baseline update.

JSX attributes and contextual object literal keys looked their property up on the whole contextual type, so when only one arm of a union declared the property as deprecated, the lookup returned nothing or a synthetic union property and nothing was reported. Like typescript-eslint, each union constituent is now checked on its own, through a constituent_deprecation helper, and object keys use the raw contextual type instead of the apparent one.

interface A { a?: string }
interface B {
  /** @deprecated Use `b` instead. */
  a?: string;
}
const x: A | B = { a: 'x' }; // now reported

Primitive constituents are skipped, as upstream, so an object literal in a string | Options context still doesn't pick up String#link (oxc-project/tsgolint#1046), although typescript-eslint reports that case.

Copilot AI balanced review requested due to automatic review settings December 1, 2026 12:40
@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-01T12:42:13.391099Z ff696d0 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 f0d654c0aedf → PR merge f9febd12141b (head ff696d045951)

Clef gate: Clef estimated 18.9% default and single-threaded wall time, 18.2% peak RSS, 27.6% single-threaded instruction count impact probability.

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

There are no active review issues for the union-member deprecation changes.

No open issues 🎉

What changed in this PR

Updates no-deprecated to detect deprecated properties on individual union members, aligning JSX attribute and contextual object literal checks with upstream tsgolint.

Changes:

  • Adds a shared helper to check each union constituent for deprecated properties.
  • Uses raw contextual types for object keys while excluding primitive constituents to avoid unrelated deprecated-member reports.
  • Adds eight regression cases and updates baseline provenance to upstream commit 56028945.
File Description
crates/​tsrs_lint/​tests/​baselines/​PROGRESS.md Records the updated upstream revision for no-deprecated.
crates/​tsrs_lint/​tests/​baselines/​no-deprecated/​REFERENCE Updates the baseline’s tsgolint commit reference.
crates/​tsrs_lint/​tests/​baselines/​no-deprecated/​baseline.json Adds optional, union, intersection, and JSX property diagnostics.
crates/​tsrs_lint/​src/​rules/​no_deprecated.rs Implements constituent-level lookup and primitive filtering for object keys.

Review effort: Balanced

@camc314
camc314 enabled stacked auto-merge December 1, 2026 12:50
@camc314
camc314 added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit 155ac73 Dec 1, 2026
21 of 27 checks passed
@camc314
camc314 deleted the fix/lint-no-deprecated-1458 branch December 1, 2026 13:23
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