← Back to Pull requests

fix(rulegen): resolve vue rule sources as `.ts` or `.js` #25895

Open
unknown opened this pull request with 239 lines diff across 2 files
View on GitHub
unknown unknown commented on Aug 19, 2026 01:09 UTC
Author

AI Disclosure: Generated with Claude Code, Opus 5. Tested and reviewed by me.

eslint-plugin-vue is migrating its rules from JS to TS one at a time, so lib/rules/ currently holds a mix of both extensions (58 .ts, 195 .js as of today). rulegen hardcoded .js, so every already-ported rule 404'd and fell back to the empty template.

Two commits:

1. Resolve the source path. Probe {rule}.ts first, fall back to {rule}.js. The resolved URL also feeds SourceType::from_path, so the parser gets the right mode. The unsupported-rule bail moved above path resolution so rejected rules don't issue the probe request.

Test paths are left alone — all 253 files in tests/lib/rules/ are already .test.ts, so a fallback there would never fire.

2. Read config from export default. The ported rules are ESM as well as TS, so RuleConfig found no module.exports assignment and silently generated a rule with no config struct. It now accepts a default-exported object literal too. This covers 57 of the 58 ported rules; the odd one out is no-extra-parens, a utils.wrapStylisticOrCoreRule(...) wrapper that the CommonJS path can't extract from either.

Testing

Ran rulegen against six rules and checked the resolved URL and generated config against the upstream schema:

| Rule | Upstream ext | Resolved | Generated config |
| --- | --- | --- | --- |
| no-restricted-component-names | .ts | .ts | FxHashSet<ConfigElement0> — matches the array/oneOf schema |
| require-valid-default-prop | .ts | .ts | none — upstream is schema: [] |
| component-options-name-casing | .ts | .ts | none, "parsed, but with errors" |
| no-boolean-default | .js | .js | ConfigElement0 enum |
| order-in-components | .js | .js | ConfigElement0 struct + Order enum |
| component-api-style | .js | .js | none, "parsed, but with errors" |

Diff: 239 lines (+179 / -60) across 2 files Reviewer: connorshea Review duration: 149200m
All Vouch review confidence checks passed
Residual risk 0.29 = Change Risk (0.49) × (1 − Review Confidence (0.41)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.49 · 239 lines diff across 2 files
0.49
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%
40%
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.328
Ai Authored ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #25895"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 40.9% 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: 49.2% (MEDIUM) · Higher = larger blast radius
49.2%
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: 40.9% · Lower = rushed or shallow review
40.9%
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: 29.1% · Safe to merge
29.1%