| created | "2025-12-16T00:00:00.000Z" |
| modified | "2026-05-09T00:00:00.000Z" |
| reviewed | "2025-12-16T00:00:00.000Z" |
| name | basedpyright-type-checking |
| description | Basedpyright static type checker for Python. Use when setting up type checking, configuring LSP, or comparing type checkers (basedpyright, pyright, mypy alternative). |
| user-invocable | false |
| allowed-tools | Bash, Read, Grep, Glob |
Basedpyright Type Checking
Basedpyright is a fork of Pyright with additional features and stricter defaults, designed for maximum type safety and performance.
When to Use This Skill
| Use this skill when... | Use another tool instead when... |
|---|
| Setting up type checking for Python | Formatting code (use ruff format) |
| Configuring strict type validation | Linting for style issues (use ruff check) |
| Comparing type checkers (basedpyright vs mypy) | Detecting unused code (use vulture/deadcode) |
| Setting up LSP for type-aware editor support | Running tests (use pytest) |
Installation
Via uv (Recommended)
uv tool install basedpyright
uv add --dev basedpyright
uv run basedpyright
Via pipx
pipx install basedpyright
Basic Usage
basedpyright
basedpyright src/ tests/
basedpyright --watch
basedpyright --outputjson
basedpyright --verbose
Configuration
Minimal Strict Configuration (pyproject.toml)
[tool.basedpyright]
typeCheckingMode = "strict"
pythonVersion = "3.12"
include = ["src"]
exclude = ["**/__pycache__", "**/.venv"]
reportUnusedCallResult = "error"
reportImplicitStringConcatenation = "error"
reportMissingSuperCall = "error"
reportUninitializedInstanceVariable = "error"
Type Checking Modes
| Mode | Description | Use Case |
|---|
off | No type checking | Legacy code, migration start |
basic | Basic type checking | Gradual typing adoption |
standard | Standard strictness | Most projects (default Pyright) |
strict | Strict type checking | Type-safe codebases |
all | Maximum strictness | High-assurance systems |
Progressive Type Checking
[tool.basedpyright]
typeCheckingMode = "basic"
include = ["src/new_module"]
include = ["src/new_module", "src/api"]
typeCheckingMode = "strict"
include = ["src"]
Choosing a Type Checker
| Factor | Basedpyright | Pyright | mypy |
|---|
| Speed | Fastest | Fastest | Slower |
| Strictness | Strictest defaults | Configurable | Configurable |
| LSP Support | Built-in | Built-in | Via dmypy |
| Plugin System | Limited | Limited | Extensive |
Choose Basedpyright for maximum type safety with stricter defaults and fastest speed.
Choose Pyright for Microsoft's official support and VS Code Pylance compatibility.
Choose mypy for extensive plugin ecosystem (django-stubs, pydantic-mypy).
Inline Error Suppression
result = unsafe_operation()
def legacy_function():
pass
Agentic Optimizations
| Context | Command |
|---|
| Quick check | basedpyright |
| JSON output | basedpyright --outputjson |
| Watch mode | basedpyright --watch |
| CI check | uv run basedpyright |
| Verbose | basedpyright --verbose |
Quick Reference
| Flag | Description |
|---|
--watch | Watch mode for development |
--outputjson | JSON output for tooling |
--verbose | Verbose diagnostics |
--pythonversion X.Y | Override Python version |
--level <mode> | Override type checking mode |
For detailed configuration options, LSP integration, migration guides, CI setup, and best practices, see REFERENCE.md.