feat: add import-x/parsers-next setting for parser instances #629
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 249 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.330
Real PR Conversation Timeline
1 comments
"Review active on #629"
general
weight: 0.35
thekhegay
Closes #381
Adds
import-x/parsers-next: list of parser instances with file extensions each one parses (shape changed to list per review, likeresolver-next)Parser is passed in, not required by name, so with pnpm or PnP it doesnt need to be resolvable from project (the
vue-eslint-parserdirect dependency workaround from silverwind's comment). Leading dot is optional, so SukkaW'stsstyle works too. It wins overimport-x/parsersfor same extension, its extensions are added toimport-x/extensions, and files it covers skip the lexer likeimport-x/parsersones. When several entries list same extension they are tried in order, ones that throw or return no AST are skipped quietly, last one keeps current warningsSetting types live in
eslint-import-context, so for now it is read with a local type inutils/parse.ts, can move there later. Per-entryparserOptionsfrom silverwind's comment not included, could follow if wanted. Full suite 4092 pass<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Added the
import-x/parsers-nextsetting to configure parser instances for specific file extensions, with ordered fallbacks when a parser cannot parse a file.Configured extensions are recognized with or without a leading dot and take precedence over existing parser mappings for matching extensions. Parser instances can be supplied directly without being resolvable from the project.
Documentation
Added guidance on configuring extension-specific parsers and parser fallbacks.
Clarified that extensions configured through either parser setting are included in extension handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->