test(linter/plugins): improve internal types#18342
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. |
There was a problem hiding this comment.
Pull request overview
This PR refactors internal type definitions to improve type safety and reduce code duplication in the linter plugin testing infrastructure. It introduces a ParserOptionsInternal type that bridges between LanguageOptionsInternal and EcmaFeaturesInternal, and consolidates duplicate type definitions across conformance test files.
Changes:
- Added
ParserOptionsInternaltype to properly extendParserOptionswithEcmaFeaturesInternal - Exported and extended
LanguageOptionsInternalto useParserOptionsInternal - Removed duplicate type definitions in conformance tests by reusing the exported types
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/oxlint/src-js/package/rule_tester.ts | Added ParserOptionsInternal interface, exported LanguageOptionsInternal, and removed unnecessary type casting |
| apps/oxlint/conformance/tester.ts | Replaced local type definitions with imported LanguageOptionsInternal and renamed ExtraCaseProps to TestCaseExtension |
| apps/oxlint/conformance/src/rule_tester.ts | Removed duplicate LanguageOptionsInternal definition and imported/re-exported from main rule tester |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
Pure refactor. 1. Add a `ParserOptionsInternal` type which bridges between `LanguageOptionsInternal` and `EcmaFeaturesInternal`. 2. Reuse `LanguageOptionsInternal` type in conformance tests, rather than redefining the same type again.
807618a to
a3914fd
Compare
f0e9bd4 to
4497f3d
Compare

Pure refactor.
ParserOptionsInternaltype which bridges betweenLanguageOptionsInternalandEcmaFeaturesInternal.LanguageOptionsInternaltype in conformance tests, rather than redefining the same type again.