Skip to content

fix(linter/typescript/no-explicit-any): fix rest parameter to unknown[] - #26279

Merged
graphite-app[bot] merged 1 commit into
mainfrom
codex/fix-no-explicit-any-rest
Sep 3, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
codex/fix-no-explicit-any-rest

Conversation

@camc314

@camc314 camc314 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Copilot AI lite review requested due to automatic review settings September 3, 2026 09:42
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 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 Completed 2026-09-03T09:44:47.798952Z 7f119d9 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 added the A-linter Area - Linter label Sep 3, 2026
@camc314 camc314 changed the title fix(linter/typescript/no-explicit-any): fix rest parameter fixer fix(linter/typescript/no-explicit-any): fix rest parameter to unknown[] Sep 3, 2026
@camc314 camc314 self-assigned this Sep 3, 2026
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Sep 3, 2026

camc314 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is narrowly scoped, aligns with expected TypeScript typing semantics for rest parameters, and includes targeted regression tests for the reported cases.

Pull request overview

This pull request updates the TypeScript no-explicit-any linter rule’s fixer so that when fixToUnknown is enabled, a bare rest-parameter type annotation (...args: any) is fixed to unknown[] (rather than unknown), aligning the fix with valid/idiomatic TypeScript rest parameter typing.

Changes:

  • Detect ...rest: any (bare any as the rest parameter’s type annotation) and replace it with unknown[] when fixToUnknown is enabled.
  • Preserve the existing element-wise behavior for any[] and Array<any> (still fixing the any element to unknown).
  • Add regression tests covering function declarations, arrow functions, call signatures, and method signatures.
File summaries
File Description
crates/oxc_linter/src/rules/typescript/no_explicit_any.rs Adjusts fixer output for bare rest-parameter any and adds regression coverage for multiple TS syntactic forms.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

…n[]` (#26279)

## Summary

- replace bare any rest parameter annotations with unknown[] when fixToUnknown is enabled
- preserve existing element-wise fixes for any[] and Array<any>
- add regression coverage for function declarations, arrow functions, call signatures, and method signatures reported in typescript-eslint/typescript-eslint#12813
@graphite-app
graphite-app Bot force-pushed the codex/fix-no-explicit-any-rest branch from 7f119d9 to 5f9cffc Compare September 3, 2026 09:46
@graphite-app
graphite-app Bot merged commit 5f9cffc into main Sep 3, 2026
31 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Sep 3, 2026
@graphite-app
graphite-app Bot deleted the codex/fix-no-explicit-any-rest branch September 3, 2026 09:52
graphite-app Bot pushed a commit that referenced this pull request Sep 7, 2026
# Oxlint
### 🚀 Features

- 6a0e19c linter/eslint/no-unmodified-loop-condition: Support `checkConditionalExpressions` option (#26249) (camc314)

### 🐛 Bug Fixes

- 562dd14 jsx-a11y/anchor-has-content: Allow anchors passed as custom component props (#26360) (Mikhail Baev)
- 253cdb2 linter/eslint/id-length: Exempt TS interface/type-literal members with never (#26310) (Pearce Ropion)
- 8c7ea76 ast_visit: Account for trimmed source offsets (#26223) (Cameron)
- 5f9cffc linter/typescript/no-explicit-any: Fix rest parameter to `unknown[]` (#26279) (camc314)
- 4de9fa3 linter/react/jsx-no-literals: Check nested JSX expression literals (#26253) (camc314)
- 07851b9 parser: Fix debug assert failure when lexer error with tokens enabled (#26229) (overlookmotel)
- 9cee146 oxlint/lsp: Don't try to parse fix message, always fallback (#26204) (Sysix)
- a662c40 linter/eslint/no-useless-assignment: Handle destructuring assignments (#25925) (camc314)
- 304bd9a linter/eslint/no-array-constructor: Handle ASI hazards in fixer (#26166) (Hamody We)
- b41bb35 linter: Qualify rules in rules output (#26250) (camc314)
- 895c685 linter/typescript/no-extraneous-class: Avoid deleting class expressions (#26231) (camc314)
- 4ba33c8 linter/eslint/no-unused-vars: Handle stored arrow references (#26225) (camc314)

### 🛡️ Security

- 9a612d5 deps: Update npm packages (#26178) (renovate[bot])
# Oxfmt
### 💥 BREAKING CHANGES

- 2c9a947 parser: [**BREAKING**] Reduce `MAX_LEN` to 256 bytes below `u32::MAX` (#26352) (overlookmotel)

### 🚀 Features

- 68e12ab formatter_css: Follow the oxc-css-parser's acceptance line (#26337) (leaysgur)

### 🐛 Bug Fixes

- f7acdc0 formatter: Treat a JSDoc cast target as opaque in chain layouts (#26375) (leaysgur)
- 104061b formatter: Keep JSDoc cast parens with a comment inside them (#26374) (leaysgur)
- 3d00a76 formatter_css: Keep comment inside important and simple-vars colon (#26370) (leaysgur)
- 172ddb6 formatter_css: Keep a same-line line comment on its line (#26321) (leaysgur)
- cafaf32 formatter_css: Never drop comments inside an at-rule prelude (#26320) (leaysgur)
- 534a0fe formatter_css: Keep a line comment on its comma's line (#26319) (leaysgur)
- 99cfd75 formatter_css: Hide raw comment printing API, use strcut instead (#26316) (leaysgur)
- 2028896 formatter_css: Preserve comments around SCSS/Less variable values (#26276) (leaysgur)
- 6752abc formatter_css: Keep leading comments before (#26272) (leaysgur)
- 3b054de formatter_graphql: Align comment printing after open `{` (#26271) (leaysgur)
- b3c287a formatter_css: Fix SCSS bracket list printing (#26270) (leaysgur)
- bac770a formatter_css: Preserve comment in SCSS paren comma list (#26269) (leaysgur)
- c7b57ef formatter_css: Print SCSS map consisntent with and without comment (#26268) (leaysgur)
- 063e2b6 formatter_css: Preserve trailing comma in single-item scss lists (#26245) (leaysgur)
- 5f9580d oxfmt: Bump prettier-plugin-tailwindcss (#26273) (leaysgur)

### ⚡ Performance

- 1cad286 oxfmt: Match editorconfig once per file (#26239) (Yuji Sugiura)
- 260c5eb oxfmt: Match `overrides` once per file (#26238) (leaysgur)
- 61565bc oxfmt: Share resolved `FormatConfig` via `Arc` instead of cloning per file (#26237) (leaysgur)

### 📚 Documentation

- 32084d4 formatter_core: Clarify printer hard_line compression (#26312) (leaysgur)
- 4fabdcc formatter,formatter_css,formatter_graphql,formatter_yaml: Update DIVERGENCES.md (#26267) (leaysgur)
- 26a1fa4 formatter_core: Refine FORMATTER_POLICY (#26266) (leaysgur)

### 🛡️ Security

- 9a612d5 deps: Update npm packages (#26178) (renovate[bot])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Sponsor
SponsoredKunjungi sekarang
Promo