type-inference

Guide Biome module graph and type inference for type-aware lint rules.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides guidance for understanding and working with Biome's complex module graph and type inference system, crucial for developing type-aware features.

Core Features & Use Cases

  • Type Resolution: Understand how Biome resolves types across modules and imports.
  • Module Graph: Learn the constraints and architecture for handling type data efficiently.
  • Use Case: When implementing a new lint rule that needs to understand the type of a JavaScript expression, use this Skill to learn how to access and interpret type information.

Quick Start

Use the type-inference skill to understand how to resolve a TypeReference to its concrete TypeData using a provided TypeResolver.

Frequently Asked Questions about type-inference

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

FAQPage Schema
How do I resolve a TypeReference to its concrete type in Biome?

Biome resolves a TypeReference by using a provided TypeResolver to traverse the module graph, flattening type data into deterministic results across local, module-level, and full resolution phases.

How does type inference work across module imports in Biome?

Biome type inference works by analyzing the module graph to track TypeData structures, enabling type-aware lint rules to understand imported types through local, module-level, and full resolution phases.

What is the best way to implement type-aware lint rules in Biome?

Implementing type-aware lint rules in Biome requires accessing TypeData structures within the module graph and using available resolvers to deterministically interpret the type of JavaScript expressions.

What are the limitations of Biome's module graph for type resolution?

Biome's module graph has architectural constraints for handling type data efficiently, requiring type flattening and phased TypeReference resolution to ensure deterministic type analysis within the Biome codebase.

Do I need to understand Rust to work with Biome's type system?

Understanding Rust is necessary for navigating Biome's type system, as the type inference architecture, module graph constraints, and TypeData structures are implemented in the Rust codebase.