Skip to content

fix(lint/no-deprecated): don't check element access keys as separate identifiers - #1212

Merged
camc314 merged 1 commit into
fix/lint-no-deprecated-1460from
fix/lint-no-deprecated-1461
Dec 1, 2026
Merged

camc314 merged 1 commit into
fix/lint-no-deprecated-1460from
fix/lint-no-deprecated-1461

Conversation

@camc314

@camc314 camc314 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Ports oxc-project/tsgolint#1461 (171becb5), including its baseline update.

An identifier used as an element access key was checked twice, once for the accessed property and again as an ordinary identifier, so a deprecated key variable was reported even when it selected a current property, and a deprecated property got a second diagnostic on the key. Like typescript-eslint, which skips computed member keys in its identifier listener and leaves them to the member check, these keys are now skipped, including through parentheses.

/** @deprecated Use a literal key. */
const key = 'x';
const obj = { x: 1 };
obj[key]; // no longer reported

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:03.116234Z 19c74ce 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.

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 were identified for the change to skip separate identifier checks for element-access keys.

No open issues 🎉

What changed in this PR

Updates no-deprecated to avoid checking element-access key identifiers separately, aligning the lint rule with upstream tsgolint behavior while preserving diagnostics for deprecated properties.

Changes:

  • Skips standalone identifier checks for element-access keys, including parenthesized keys.
  • Adds baseline cases for deprecated keys and properties, and updates upstream tracking to 171becb5.
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 Pins the baseline’s tsgolint reference commit.
crates/​tsrs_lint/​tests/​baselines/​no-deprecated/​baseline.json Covers skipped key diagnostics and retained property diagnostics.
crates/​tsrs_lint/​src/​rules/​no_deprecated.rs Skips separate identifier checks for element-access 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 8a89515 Dec 1, 2026
19 checks passed
@camc314
camc314 deleted the fix/lint-no-deprecated-1461 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