Skip to content

ogghead/starlint

Repository files navigation

starlint

A fast, Rust-based JavaScript/TypeScript linter with first-class WASM plugin support.

Features

  • Fast: Hand-written recursive descent parser, flat indexed AST, single-pass traversal, streaming output
  • 709 rules: Covers JS, TS, React, Next.js, Vue, Jest, Vitest, JSDoc, Storybook, and more
  • WASM plugins: Write lint rules in Rust (or any language targeting WASM) using the Component Model
  • Auto-fix: Safe and dangerous fix categories with --fix and --fix-dangerous, multi-pass convergence
  • Parallel: File-level parallelism via rayon
  • LSP: Built-in language server for editor integration (VS Code extension included)
  • Configurable: starlint.toml with rule severity overrides, file pattern overrides, and per-plugin control

Benchmarks

Compared against oxlint and eslint on real-world codebases with 20 equivalent lint rules.

Corpus Files starlint oxlint eslint
express 141 14ms (13 MB) 80ms (114 MB) 1.38s (240 MB)
date-fns 1562 68ms (12 MB) 78ms (116 MB) 4.47s (443 MB)
grafana 6259 545ms (38 MB) 336ms (138 MB) 31.74s (565 MB)
All rules (~630-710 rules per tool)
Corpus Files starlint oxlint eslint
express 141 58ms (19 MB) 279ms (137 MB) 12.49s (721 MB)

Last updated: 2026-03-15. Benchmarked with hyperfine (3 warmup, 10+ runs).

Flamegraph

Profiling starlint on the Grafana codebase (~6k files) with default rules:

Flamegraph

Click for interactive view. Auto-generated on each push to master.

Quick Start

# Build
cargo build --workspace

# Run on current directory
cargo run -- .

# Initialize config
cargo run -- init

# Apply auto-fixes
cargo run -- fix .

# Start LSP server
cargo run -- lsp

# List all available rules
cargo run -- rules

Configuration

Create a starlint.toml in your project root:

[settings]
threads = 0  # 0 = auto-detect

# Enable/disable plugins (all enabled by default when section omitted)
[plugins]
core = true            # General JS/TS rules
react = true           # React + JSX A11y + React Perf
typescript = true      # TypeScript rules
testing = true         # Jest + Vitest
modules = true         # Import + Node + Promise
nextjs = true          # Next.js rules
vue = true             # Vue rules
jsdoc = true           # JSDoc rules
storybook = true       # Storybook rules
custom = { path = "./plugins/custom-plugin.wasm" }  # External WASM

# Per-rule severity
[rules]
"no-debugger" = "error"
"typescript/no-explicit-any" = "warn"
"no-var" = "off"

# File-pattern overrides
[[overrides]]
files = ["**/*.stories.tsx"]
[overrides.rules]
"storybook/default-exports" = "error"

Rules

709 rules organized into 9 plugin bundles:

Category Rules Plugin
General (JS/TS) 326 core
TypeScript 99 typescript
React 55 react
JSX A11y 31 react
Jest 54 testing
Vitest 17 testing
Import 33 modules
Promise 16 modules
Next.js 21 nextjs
JSDoc 18 jsdoc
Vue 17 vue
Storybook 15 storybook
Node 6 modules
React Perf 4 react

Contributing

See CONTRIBUTING.md for architecture, development workflow, and how to add rules.

License

MIT

About

A fast Typescript/JavaScript linter with WASM plugin support

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages