← Back to Pull requests

feat: add import-x/parsers-next setting for parser instances #629

Open
unknown opened this pull request with 249 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 12, 2026 09:28 UTC
Author

Closes #381

Adds import-x/parsers-next: list of parser instances with file extensions each one parses (shape changed to list per review, like resolver-next)

settings: {
  'import-x/parsers-next': [
    { parser: tseslint.parser, extensions: ['.ts', '.tsx', '.mts', '.cts'] },
    { parser: vueParser, extensions: ['.vue'] },
  ],
},

Parser is passed in, not required by name, so with pnpm or PnP it doesnt need to be resolvable from project (the vue-eslint-parser direct dependency workaround from silverwind's comment). Leading dot is optional, so SukkaW's ts style works too. It wins over import-x/parsers for same extension, its extensions are added to import-x/extensions, and files it covers skip the lexer like import-x/parsers ones. 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 warnings

Setting types live in eslint-import-context, so for now it is read with a local type in utils/parse.ts, can move there later. Per-entry parserOptions from 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-next setting 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 -->

Diff: 249 lines (+186 / -63) across 3 files Reviewer: thekhegay Review duration: 3071m
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
0.39
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 39.0% (MEDIUM) · Higher = larger blast radius
39.0%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 20.8% · Safe to merge
20.8%