skillfed

lint-rule-development

This skill guides you through building new lint rules and assist actions for Biome. It covers rule scaffolding across multiple languages, implementation patterns with semantic analysis, code action setup, and the three-pillar diagnostic framework required for all rules. Use it when adding custom rules like noVar or useConst to Biome's codebase.

lint-rule-development helps you create and implement new lint rules for Biome's JavaScript, CSS, JSON, and GraphQL analyzers.

AI-generated summary based on this skill's SKILL.md

25,418 1,157 Apache-2.0 updated by biomejs

Install

biomejs/biome/lint-rule-development · repository language: Rust

git clone https://github.com/biomejs/biome
cp -r biome/.claude/skills/lint-rule-development ~/.claude/skills/lint-rule-development
npx skillfed install biomejs/biome/lint-rule-development

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I create a lint rule in Biome?

Lint-rule-development guides you through scaffolding and implementing new rules for Biome's analyzer. Start by using Biome's code generation tools to create rule boilerplate, then implement your rule logic following the three-pillar diagnostic pattern: message clarity, code action setup, and semantic analysis where needed. The skill covers rule structure across multiple languages and walks you through adding features like configurable options and automatic fixes.

What is the three-pillar pattern for Biome diagnostics?

Lint-rule-development emphasizes writing high-quality diagnostics using Biome's three-pillar framework. This pattern ensures each diagnostic includes clear messaging, proper code actions (assist actions or fixes), and correct semantic context. Following this pattern is mandatory for all lint rules in Biome and helps maintain consistency across the analyzer's rule set.

How do I add code actions and automatic fixes to Biome rules?

Lint-rule-development covers adding code actions to lint rules through assist actions and automatic fixes. You'll learn to configure fix kinds (safe vs. unsafe), implement the fix logic that transforms code, and integrate them into your diagnostic. The skill shows how to structure these actions so they appear in Biome's IDE integrations and CLI output.

What are binding references in Biome semantic analysis?

Lint-rule-development teaches semantic analysis rules using binding references to track variable declarations and usage. This approach lets you build rules like noVar or useConst that understand code scope and relationships. The skill explains how to query bindings, traverse semantic trees, and write rules that go beyond syntax-only pattern matching.

How do I test Biome lint rules with snapshot tests?

Lint-rule-development covers testing lint rules using snapshot tests and magic comments. You'll learn to mark expected diagnostics with comments, run quick test harnesses to validate rule behavior, and verify that fixes produce correct output. The skill includes patterns for testing both the diagnostics themselves and the code actions they provide.

Can I make Biome lint rules configurable with options?

Lint-rule-development shows how to build configurable lint rules with custom options. You'll define rule parameters, validate user input, and adjust rule behavior based on configuration. The skill covers naming conventions (like noVar and useConst examples), rule state management, and integration with Biome's configuration system.

SKILL.md

rendered from the published skill — quoted content, verbatim

Purpose

Use this skill when creating new lint rules or assist actions for Biome. It provides scaffolding commands, implementation patterns, testing workflows, and documentation guidelines.

Prerequisites

  1. Install required tools: just install-tools
  2. Ensure cargo, just, and pnpm are available
  3. Read crates/biome_analyze/CONTRIBUTING.md for in-depth concepts

Common Workflows

Create a New Lint Rule

Generate scaffolding for a JavaScript lint rule:

just new-js-lintrule useMyRuleName

For other languages:

just new-css-lintrule myRuleName
just new-json-lintrule myRuleName
just new-graphql-lintrule myRuleName

This creates a file in

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 2 files
.claude/skills/lint-rule-development/SKILL.md
.claude/skills/lint-rule-development/references/OPTIONS.md

Related skills

Tags

rule-scaffolding semantic-analysis code-actions diagnostic-pillars test-automation configurable-rules ast-traversal performance-patterns fix-generation nursery-group