type-inference
This skill teaches you how to work with Biome's type inference engine and module graph architecture for building type-aware lint rules. It covers the three-phase type resolution process—local inference, module-level resolution, and cross-module full inference—plus the TypeReference pattern that prevents stale data in an IDE environment. Use it when implementing new type-aware rules, understanding type resolution, or working on type inference features.
type-inference helps you implement type-aware lint rules by guiding you through Biome's module graph and type resolution architecture.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-07-27
type-inference helps you implement type-aware lint rules by guiding you through Biome's module graph and type resolution architecture. This skill teaches you how to work with Biome's type inference engine and module graph architecture for building type-aware lint rules. It covers the three-phase type resolution process—local inference, module-level resolution, and cross-module full inference—plus the TypeReference pattern that prevents stale data in an IDE environment. Use it when implementing new type-aware rules, understanding type resolution, or working on type inference features.
Use it when
- Biome's module graph architecture organizes type information across files without cloning data.
- The type-inference skill covers TypeResolver as the core trait for resolving types across modules.
Verify before relying
Read SKILL.md below before installing (1 file). Open directory: indexed for reading, not audited.
Install
biomejs/biome/type-inference · repository language: Rust
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I implement type-aware lint rules using Biome's type inference?
Biome's type-inference skill teaches you to build lint rules that leverage the type inference engine. Start by understanding the three-phase resolution process: local inference (within a file), module-level resolution (across a module), and cross-module full inference. Use TypeResolver to access resolved types, and apply the TypeReference pattern to avoid stale data in IDE environments. This approach lets you write rules that understand type relationships and catch type-related issues.
What is the biome module graph architecture and its constraints?
Biome's module graph architecture organizes type information across files without cloning data. The key constraint is that the module graph prevents unnecessary data duplication, which keeps the IDE responsive. The architecture uses TypeData enum variants to represent different type states and ResolvedTypeId structures to track resolved types. Understanding these constraints helps you work within the system's design when implementing cross-file lint rules or resolving types across module boundaries.
How do I resolve types across module boundaries with TypeResolver?
The type-inference skill covers TypeResolver as the core trait for resolving types across modules. TypeResolver handles the three resolution phases and returns ResolvedTypeId structures that point to resolved types. When working with TypeResolver, you access types without cloning them, respecting the module graph's no-cloning constraint. This is essential for implementing lint rules that need to understand types defined in other files or modules.
What does type-inference cover for CSS and HTML class tracking?
Type-inference includes guidance on working with CSS and HTML class tracking within the module graph. This feature allows lint rules to understand class relationships across files, enabling cross-file analysis. The module graph's architecture supports tracking class references and their type information, which is useful for rules that validate styling consistency or detect unused classes.
How do I debug type inference and flattening for new Biome features?
Type-inference provides techniques for debugging the type flattening process and inference engine when building new features. Understanding how TypeData enum variants flow through the three resolution phases helps you trace where inference might fail. The skill covers how Biome's Salsa-based caching system supports type inference, allowing you to identify performance bottlenecks and correctness issues in your type-aware implementations.
What is the TypeReference pattern and why does it matter in Biome?
The TypeReference pattern is central to type-inference and prevents stale type data in IDE environments. Instead of storing direct type references that can become outdated, TypeReference uses indirection to always point to current type information. This design keeps the IDE responsive and accurate, especially when files change. Understanding this pattern is crucial for implementing reliable type-aware lint rules that work correctly across IDE sessions.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
Purpose
Use this skill when working with Biome's type inference system and module graph. Covers type references, resolution phases, and the architecture designed for IDE performance.
Prerequisites
- Read
crates/biome_js_type_info/CONTRIBUTING.mdfor architecture details - Understand Biome's focus on IDE support and instant updates
- Familiarity with TypeScript type system concepts
Key Concepts
Module Graph Constraint
Critical rule: No module may copy or clone data from another module, not even behind Arc.
Why: Any module can be updated at any time (IDE file changes). Copying data would create stale references that are hard to invalidate.
Solution: Use TypeReference instead of direct type references.
Type Data Structure
Types are stored in TypeData enum
(truncated - see the full file via the links below)
File tree — 1 file
.claude/skills/type-inference/SKILL.md
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Implement type-aware lint rules using Biome's type inference”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
This skill guides developers working on Biome's codebase through essential patterns and pitfalls. It covers AST and syntax node navigation, efficient string extraction without allocation, and handling embedded languages across frameworks like Vue and Svelte. Use it to write cleaner, more maintainable code and avoid costly mistakes when extending Biome's parser, analyzer, and formatter.
This skill establishes documentation standards for Biome developers writing comments and rustdoc in the codebase. It distinguishes three comment types—module docs for explanation, item docs for reference, and inline comments for rationale—and teaches which patterns to avoid. The core principle: write for future contributors with no access to your current context, stating how code works rather than how it came to be.
This skill teaches you how to add parsing support for new languages to Biome by authoring grammars in ungrammar format, implementing lexers and token sources, and writing parse rules with robust error recovery. It covers list parsing patterns, conditional syntax handling, and testing workflows for the Biome codebase.
Biome integrates into .NET repositories to provide combined formatting, linting, and import organization across JavaScript, TypeScript, CSS, JSON, GraphQL, and HTML. The skill handles ownership decisions between Biome and existing tools like ESLint or Prettier, generates configuration, and establishes repeatable commands for CI and local development. It guides migration strategies and validates that your build and test flows remain stable after changes.
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.
This skill covers seven Rust design patterns applied to RTK's CLI filter architecture, from type-safe wrappers and configuration builders to stateful parsers and resource management. Each pattern includes practical examples showing when to use it, when to skip it, and how it fits RTK's single-threaded, zero-overhead design philosophy.
More skills biome (MIT) · storage-format (MIT) · add-generation-support (Apache-2.0) · diagnostics-development (Apache-2.0)