fix: translate import-lite `consistent-type-specifier-style` options #589
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.47) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 287 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.339
Real PR Conversation Timeline
1 comments
"Review active on #589"
general
weight: 0.35
connorshea
Any project using
@antfu/eslint-configgets a config oxlint refuses to load. antfu registerseslint-plugin-import-liteasimportand setsimport/consistent-type-specifier-styleto["error", "top-level"]. The migrator copies that option unchanged:The
nuxt-authsnapshot (an antfu config) already contained the invalid value.import-lite renamed the modes (
prefer-top-level→top-level,prefer-inline→inline) and reusedprefer-top-levelfor a looser mode. This PR maps them infixForAntfuEslintConfig, after the plugin renames:| import-lite | Oxlint |
|---|---|
|
top-level|prefer-top-level||
inline|prefer-inline||
prefer-top-level|prefer-top-level-if-only-type-imports|The mapping only runs when the plugin registered as
importis import-lite, which is when its rule schema liststop-level. Withantfu({ imports: false }), users can register eslint-plugin-import asimport, and thereprefer-top-levelkeeps its strict meaning. I checked the third row with import-lite's own test cases run through oxlint:| Case | import-lite
prefer-top-level| oxlintprefer-top-level-if-only-type-imports||---|---|---|
|
import { Foo, type Bar }| valid | valid ||
import { type Foo, type Bar }| invalid | reported |A config that exports
await antfu()instead of the composer skipsfixForAntfuEslintConfig, same as the plugin renames, so it still getstop-level.Repro: https://github.com/onmax/repros/tree/repro/oxlint-migrate-import-lite-type-specifier-style (
pnpm install --frozen-lockfile && pnpm verifyin the fixture; verification.log shows the failing fixture and the patched sibling).Tests: new cases in
src/js_plugin_fixes.spec.tsrun throughfixForJsPlugins. The three mappings fail onmain, and eslint-plugin-import'sprefer-top-levelstays unchanged. Thenuxt-authsnapshot is updated.vitest run,oxlint --type-aware --type-check,oxfmt --checkandtsc --noEmitpass.