chore(linter/prefer-as-const): re-port test cases from upstream#18898
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
Merge activity
|
There was a problem hiding this comment.
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
asexpressions - Simplified fix test case format from 3-tuple to 2-tuple (removing unnecessary
Noneparameter) - 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 Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes
|
262fb46 to
79089b4
Compare

No description provided.