refactor(diagnostics): use structured action data - #156
Conversation
📦 Package Bundle SizeNo bundle size changes. |
📝 WalkthroughWalkthroughDiagnostic rules now attach structured package and version metadata to diagnostics. Diagnostic types define the supported metadata fields. Code-action generation validates this data and uses it to build fixes without parsing diagnostic messages with regular expressions. A new Merge Risk: 🔵 Low · up to The refactor makes code actions use structured package and version data instead of parsing diagnostic text. It is mergeable with owner awareness because malformed metadata could produce incorrect edits or ignore-command arguments if diagnostics can come from outside the trusted producers; validating these values or documenting the trusted boundary is recommended. 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/language-service/src/plugins/diagnostics/types.ts (1)
13-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReuse the exported diagnostic data contract in
actions.ts.
packages/language-service/src/plugins/diagnostics/actions.tsstill declares a secondDiagnosticActionDataat Lines 13-17. Import the type from./typesand remove the local declaration. This keeps the producer and consumer on one contract and prevents future field drift.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4310280b-2ed5-409c-b7c7-68b44984c296
📒 Files selected for processing (11)
packages/language-service/src/plugins/diagnostics/actions.tspackages/language-service/src/plugins/diagnostics/index.tspackages/language-service/src/plugins/diagnostics/rules/deprecation.test.tspackages/language-service/src/plugins/diagnostics/rules/deprecation.tspackages/language-service/src/plugins/diagnostics/rules/replacement.test.tspackages/language-service/src/plugins/diagnostics/rules/replacement.tspackages/language-service/src/plugins/diagnostics/rules/upgrade.test.tspackages/language-service/src/plugins/diagnostics/rules/upgrade.tspackages/language-service/src/plugins/diagnostics/rules/vulnerability.test.tspackages/language-service/src/plugins/diagnostics/rules/vulnerability.tspackages/language-service/src/plugins/diagnostics/types.ts
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
No description provided.