diagnostics-development

Create lint rule diagnostics with embedded fixes and formatted markup.

25.5k|1.2k|Updated Jul 27, 2023
One-click install
npx skills add https://github.com/biomejs/biome --skill diagnostics-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: diagnostics-development
Source: https://github.com/biomejs/biome/tree/main/.claude/skills/diagnostics-development
Command: npx skills add https://github.com/biomejs/biome --skill diagnostics-development

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill guides developers in creating high-quality, user-friendly diagnostics (error messages, warnings, hints) within the Biome codebase, ensuring clear communication of issues to users.

Core Features & Use Cases

  • Diagnostic Creation: Learn to implement the Diagnostic trait and use the #[derive(Diagnostic)] macro.
  • Advice Implementation: Understand how to add helpful context, fixes, and explanations using various advice types (Log, CodeFrame, Diff, Command).
  • Markup Usage: Master the markup! macro for rich text formatting, including emphasis, code, and hyperlinks.
  • Use Case: When developing a new lint rule, use this Skill to define precise error messages and actionable advice that helps users quickly understand and fix the reported code issue.

Quick Start

Use the diagnostics-development skill to create a new diagnostic type for a lint rule.

Frequently Asked Questions about diagnostics-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement the Diagnostic trait in Biome to create clear error messages?

To create Biome diagnostics, implement the `Diagnostic` trait or use the `#[derive(Diagnostic)]` macro. This defines precise error messages and actionable advice for your lint rules, ensuring users understand reported code issues.

What advice types are available when building Biome diagnostics for lint rules?

Biome diagnostics support several advice types, including Log, CodeFrame, Diff, and Command. These allow you to add helpful context, suggest fixes, and provide detailed explanations directly within the diagnostic output.

How do I use the markup macro for rich text formatting in Biome diagnostics?

The `markup!` macro enables rich text formatting in Biome diagnostics. You use it to apply emphasis, format inline code snippets, and add hyperlinks within error messages, creating a more readable and actionable output for developers.

What is the best way to provide actionable fixes in Biome lint rules?

The best way to provide actionable fixes in Biome is by utilizing advice types like Diff and Command. These mechanisms attach suggested code changes and helpful context directly to the diagnostic, allowing users to quickly resolve reported issues.

When should I use the derive Diagnostic macro instead of implementing the trait manually?

Use the `#[derive(Diagnostic)]` macro for standard lint rule errors to reduce boilerplate, and implement the `Diagnostic` trait manually when you need custom diagnostic logic or highly specialized advice types beyond the macro's defaults.