Skip to content

feat(linter): implement fixer for unicorn/no-typeof-undefined#19274

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/12-14-feat_linter_no-typeof-undefined_implement_fixer
Feb 11, 2026
Merged

feat(linter): implement fixer for unicorn/no-typeof-undefined#19274
graphite-app[bot] merged 1 commit intomainfrom
c/12-14-feat_linter_no-typeof-undefined_implement_fixer

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Feb 11, 2026

No description provided.

Copy link
Contributor Author

camc314 commented Feb 11, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added A-linter Area - Linter C-enhancement Category - New feature or request labels Feb 11, 2026
@camc314 camc314 self-assigned this Feb 11, 2026
@camc314 camc314 marked this pull request as ready for review February 11, 2026 17:28
Copilot AI review requested due to automatic review settings February 11, 2026 17:28
@camc314 camc314 changed the title feat(linter/no-typeof-undefined): implement fixer feat(linter): implement fixer for unicorn/no-typeof-undefined Feb 11, 2026
@camc314 camc314 force-pushed the c/12-14-feat_linter_no-typeof-undefined_implement_fixer branch 2 times, most recently from 55bd229 to e3a8891 Compare February 11, 2026 17:30
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 11, 2026

Merging this PR will not alter performance

✅ 47 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing c/12-14-feat_linter_no-typeof-undefined_implement_fixer (a204eda) with main (dd0220f)2

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (a204eda) during the generation of this report, so dd0220f was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 11, 2026

Merge activity

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an auto-fixer for the unicorn/no-typeof-undefined lint rule and updates snapshots/tests to reflect fix output.

Changes:

  • Mark unicorn/no-typeof-undefined as fixable and emit fixes/suggestions via the linter fixer infrastructure.
  • Generate replacement text to convert typeof x === "undefined"-style checks into direct x === undefined comparisons (including normalizing ==/!= to ===/!==).
  • Update rule snapshots and add fixer expectations in the rule test.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
crates/oxc_linter/src/rules/unicorn/no_typeof_undefined.rs Implements the fixer/suggestion logic and adds fixer test cases.
crates/oxc_linter/src/snapshots/unicorn_no_typeof_undefined.snap Updates snapshot output to include fix help text for fixable cases.

@graphite-app graphite-app bot force-pushed the c/12-14-feat_linter_no-typeof-undefined_implement_fixer branch from e3a8891 to a204eda Compare February 11, 2026 17:37
@graphite-app graphite-app bot merged commit a204eda into main Feb 11, 2026
29 checks passed
@graphite-app graphite-app bot deleted the c/12-14-feat_linter_no-typeof-undefined_implement_fixer branch February 11, 2026 17:42
camc314 added a commit that referenced this pull request Feb 12, 2026
# Oxlint
### 🚀 Features

- ebb80b3 ast: Add `node_id` field to all AST struct nodes (#18138)
(Boshen)
- 2879fc5 linter: Implement fixer for unicorn/prefer-math-trunc (#19275)
(camc314)
- a204eda linter: Implement fixer for unicorn/no-typeof-undefined
(#19274) (camc314)
- ab46d9c linter: Implement typescript/class-literal-property-style
(#19252) (Vincent R)
- 1a61f58 linter: Implement typescript/no-invalid-void-type (#19242)
(Vincent R)

### 🐛 Bug Fixes

- 45adda2 oxlint/lsp: Use blocking stdio in Oxlint (#19292)
(overlookmotel)
- 05bc855 linter/import: Count unique module sources in max-dependencies
(#19270) (camc314)
- 8566b44 linter: Check for preceeding token in math trunc fixer
(#19277) (camc314)
- f16f2b6 linter/import-no-cycle: Avoid traversal-order false negatives
with type-only edges (#19267) (camc314)
- d4937e7 linter: Recognize module-scoped callback refs as stable in
exhaustive-deps (#19220) (Sreetam Das)
- 140c9bd linter: Detect fallthrough from `default` when it is not the
last case (#19261) (Boshen)
- 740a009 linter: Accept digits after 'use' in hook names (#19254)
(Sreetam Das)
- 31b562f linter: Update `import/no-named-as-default` to allow named
import if equivalent to the default import (#19100) (connorshea)
- 79c82cc linter: Avoid applying object-level docs to nested object
methods in require-param (#19231) (camc314)

### ⚡ Performance

- 5670291 linter/class-literal-property-style: Avoid unneeded string
allocations (#19262) (camc314)
# Oxfmt
### 🚀 Features

- ebb80b3 ast: Add `node_id` field to all AST struct nodes (#18138)
(Boshen)

### 🐛 Bug Fixes

- 1957908 formatter: Avoid unnecessary parentheses for string literal in
labeled statement (#19272) (Dunqing)

Co-authored-by: camc314 <[email protected]>
OskarLebuda pushed a commit to OskarLebuda/oxc that referenced this pull request Feb 17, 2026
# Oxlint
### 🚀 Features

- ebb80b3 ast: Add `node_id` field to all AST struct nodes (oxc-project#18138)
(Boshen)
- 2879fc5 linter: Implement fixer for unicorn/prefer-math-trunc (oxc-project#19275)
(camc314)
- a204eda linter: Implement fixer for unicorn/no-typeof-undefined
(oxc-project#19274) (camc314)
- ab46d9c linter: Implement typescript/class-literal-property-style
(oxc-project#19252) (Vincent R)
- 1a61f58 linter: Implement typescript/no-invalid-void-type (oxc-project#19242)
(Vincent R)

### 🐛 Bug Fixes

- 45adda2 oxlint/lsp: Use blocking stdio in Oxlint (oxc-project#19292)
(overlookmotel)
- 05bc855 linter/import: Count unique module sources in max-dependencies
(oxc-project#19270) (camc314)
- 8566b44 linter: Check for preceeding token in math trunc fixer
(oxc-project#19277) (camc314)
- f16f2b6 linter/import-no-cycle: Avoid traversal-order false negatives
with type-only edges (oxc-project#19267) (camc314)
- d4937e7 linter: Recognize module-scoped callback refs as stable in
exhaustive-deps (oxc-project#19220) (Sreetam Das)
- 140c9bd linter: Detect fallthrough from `default` when it is not the
last case (oxc-project#19261) (Boshen)
- 740a009 linter: Accept digits after 'use' in hook names (oxc-project#19254)
(Sreetam Das)
- 31b562f linter: Update `import/no-named-as-default` to allow named
import if equivalent to the default import (oxc-project#19100) (connorshea)
- 79c82cc linter: Avoid applying object-level docs to nested object
methods in require-param (oxc-project#19231) (camc314)

### ⚡ Performance

- 5670291 linter/class-literal-property-style: Avoid unneeded string
allocations (oxc-project#19262) (camc314)
# Oxfmt
### 🚀 Features

- ebb80b3 ast: Add `node_id` field to all AST struct nodes (oxc-project#18138)
(Boshen)

### 🐛 Bug Fixes

- 1957908 formatter: Avoid unnecessary parentheses for string literal in
labeled statement (oxc-project#19272) (Dunqing)

Co-authored-by: camc314 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments