fix(rulegen): resolve vue rule sources as `.ts` or `.js` #25895
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
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.328
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #25895"
general
weight: 0.35
connorshea
AI Disclosure: Generated with Claude Code, Opus 5. Tested and reviewed by me.
eslint-plugin-vueis migrating its rules from JS to TS one at a time, solib/rules/currently holds a mix of both extensions (58.ts, 195.jsas 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}.tsfirst, fall back to{rule}.js. The resolved URL also feedsSourceType::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, soRuleConfigfound nomodule.exportsassignment 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 isno-extra-parens, autils.wrapStylisticOrCoreRule(...)wrapper that the CommonJS path can't extract from either.Testing
Ran
rulegenagainst 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/oneOfschema ||
require-valid-default-prop|.ts|.ts| none — upstream isschema: []||
component-options-name-casing|.ts|.ts| none, "parsed, but with errors" ||
no-boolean-default|.js|.js|ConfigElement0enum ||
order-in-components|.js|.js|ConfigElement0struct +Orderenum ||
component-api-style|.js|.js| none, "parsed, but with errors" |