Skip to content

chore(linter/prefer-as-const): re-port test cases from upstream#18898

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/02-03-chore_linter_prefer-as-const_re-port_test_cases_from_upstream
Feb 3, 2026
Merged

chore(linter/prefer-as-const): re-port test cases from upstream#18898
graphite-app[bot] merged 1 commit intomainfrom
c/02-03-chore_linter_prefer-as-const_re-port_test_cases_from_upstream

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Feb 3, 2026

No description provided.

@github-actions github-actions bot added A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Feb 3, 2026
Copy link
Contributor Author

camc314 commented Feb 3, 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.

@camc314 camc314 self-assigned this Feb 3, 2026
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Feb 3, 2026
@camc314 camc314 marked this pull request as ready for review February 3, 2026 16:14
Copilot AI review requested due to automatic review settings February 3, 2026 16:14
Copy link
Contributor Author

camc314 commented Feb 3, 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 re-ports test cases for the typescript/prefer-as-const rule from the upstream typescript-eslint project. The changes expand test coverage by adding more test cases for both passing and failing scenarios.

Changes:

  • Reformatted existing single-line class test cases to multi-line format for better readability
  • Added new test cases for object properties and as expressions
  • Simplified fix test case format from 3-tuple to 2-tuple (removing unnecessary None parameter)
  • Updated snapshot file to reflect the new test cases
  • Preserved commented-out test cases for TSX angle bracket syntax that OXC doesn't yet support

Reviewed changes

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

File Description
crates/oxc_linter/src/rules/typescript/prefer_as_const.rs Expanded test cases for pass, fail, and fix scenarios; reformatted class test cases to multi-line format; simplified fix test tuple format
crates/oxc_linter/src/snapshots/typescript_prefer_as_const.snap Updated snapshot to reflect new test cases and multi-line formatting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 3, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing c/02-03-chore_linter_prefer-as-const_re-port_test_cases_from_upstream (262fb46) with main (ec39944)1

Summary

✅ 46 untouched benchmarks
⏩ 3 skipped benchmarks2

Footnotes

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

  2. 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.

@graphite-app graphite-app bot force-pushed the c/02-03-chore_linter_prefer-as-const_re-port_test_cases_from_upstream branch from 262fb46 to 79089b4 Compare February 3, 2026 16:31
@graphite-app graphite-app bot merged commit 79089b4 into main Feb 3, 2026
21 checks passed
@graphite-app graphite-app bot deleted the c/02-03-chore_linter_prefer-as-const_re-port_test_cases_from_upstream branch February 3, 2026 16:36
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants