Denji

Ultracite

Integrate Denji with Ultracite for zero-config Biome preset

Ultracite is a highly opinionated, zero-configuration preset for JavaScript and TypeScript linting and formatting. It supports three major toolchains:

  • Biome — The modern, all-in-one toolchain written in Rust
  • ESLint + Prettier + Stylelint — The most mature and comprehensive linting ecosystem
  • Oxlint + Oxfmt — The fastest linter available, 50-100x faster than ESLint

Quick Start

The fastest way to get started is using the interactive installer:

npx ultracite init

This will:

  1. Detect your project structure
  2. Ask which toolchain you prefer (Biome, ESLint+Prettier, or Oxlint+Oxfmt)
  3. Install necessary dependencies
  4. Create appropriate configuration files
  5. Set up editor integration

For manual installation, run npm install -D ultracite and then configure your preferred toolchain.

How It Works

Once set up, Ultracite runs mostly in the background — automatically formatting your code and applying fixes every time you save your files. Because the underlying tools are highly optimized (especially the Rust-based Biome and Oxlint), running Ultracite's checks is extremely fast and can comfortably run on every save without lag. This means you can focus on building and shipping instead of manually correcting style issues or debugging runtime errors.

Basic Setup

Add Ultracite to your Denji hooks to automatically fix and format icons after adding them:

denji.json
{
  "output": "./src/icons.tsx",
  "framework": "react",
  "typescript": true,
  "hooks": {
    "postAdd": [
      "npx ultracite fix ./src/icons.tsx"
    ]
  }
}

Configuration Examples

Fix with All Safe Fixes

denji.json
{
  "hooks": {
    "postAdd": [
      "npx ultracite fix ./src/icons.tsx"
    ]
  }
}

Check Only

denji.json
{
  "hooks": {
    "preAdd": [
      "npx ultracite check ./src/icons.tsx"
    ]
  }
}

Multiple Hooks

Run Ultracite after various operations:

denji.json
{
  "hooks": {
    "postAdd": [
      "npx ultracite fix ./src/icons.tsx"
    ],
    "postRemove": [
      "npx ultracite fix ./src/icons.tsx"
    ],
    "postClear": [
      "npx ultracite fix ./src/icons.tsx"
    ]
  }
}

Apply Unsafe Fixes

For more aggressive fixes:

denji.json
{
  "hooks": {
    "postAdd": [
      "npx ultracite fix --unsafe ./src/icons.tsx"
    ]
  }
}

Use --unsafe with caution as it may apply fixes that change code behavior. Review changes carefully.

Common Commands

npx ultracite fix ./src/icons.tsx

Runs linter and formatter with automatic fixes applied. This is the most common command.

npx ultracite check ./src/icons.tsx

Checks for issues without modifying files. Useful for CI pipelines or pre-commit hooks.

npx ultracite fix --unsafe ./src/icons.tsx

Applies potentially breaking changes for more aggressive fixes.

npx ultracite fix --linter biome ./src/icons.tsx

Uses a specific linter. Options: biome, eslint, oxlint.

Ultracite Commands

fix

Fixes all auto-fixable issues:

# Fix all files
npx ultracite fix

# Fix specific files
npx ultracite fix ./src/icons.tsx

# Apply unsafe fixes
npx ultracite fix --unsafe ./src/icons.tsx

# Use specific linter
npx ultracite fix --linter biome ./src/icons.tsx

check

Checks for issues without fixes:

# Check all files
npx ultracite check

# Check specific files
npx ultracite check ./src/icons.tsx

# Filter by severity
npx ultracite check --diagnostic-level error ./src/icons.tsx

doctor

Diagnoses setup and configuration:

npx ultracite doctor

Core Principles

Ultracite is designed with these key goals:

Lightning-Fast Performance

Ultracite benefits from the performance of Rust-based tools like Biome and Oxlint, enabling instant feedback even on large codebases. This allows it to run automatically on every file save without lag.

Zero-Config by Design

Ultracite is designed to be zero-config by default. This allows new users to get started quickly without needing to configure their linter or formatter, saving teams time when onboarding new developers.

The goal is to provide a default configuration that works for most projects, while still allowing customization for those who need it.

Intuitive and Simple

Ultracite should be as invisible as possible. Preferably, it should not require any configuration or action from the user. When feedback is needed, it should be easy to understand and act on.

Maximum Type Safety

Ultracite is designed to be as type-safe as possible. It uses TypeScript's strict mode and additional lint rules to catch errors and provide suggestions for improvements.

Plays Nice with Others

Ultracite works alongside other tools and libraries without conflict. You can choose the toolchain that best fits your project's needs.

Toolchain Selection

Ultracite automatically detects and uses the appropriate linter:

  1. Checks for biome.json → uses Biome
  2. Checks for .eslintrc.* or eslint.config.js → uses ESLint + Prettier + Stylelint
  3. Checks for oxlint.json → uses Oxlint + Oxfmt
  4. Falls back to Biome (default)

You can also explicitly specify a toolchain:

npx ultracite fix --linter biome ./src/icons.tsx
npx ultracite fix --linter eslint ./src/icons.tsx
npx ultracite fix --linter oxlint ./src/icons.tsx

Package Manager Alternatives

{
  "hooks": {
    "postAdd": ["npx ultracite fix ./src/icons.tsx"]
  }
}
{
  "hooks": {
    "postAdd": ["pnpm exec ultracite fix ./src/icons.tsx"]
  }
}
{
  "hooks": {
    "postAdd": ["yarn exec ultracite fix ./src/icons.tsx"]
  }
}
{
  "hooks": {
    "postAdd": ["bunx ultracite fix ./src/icons.tsx"]
  }
}

Using Package Scripts

Define a script in package.json:

package.json
{
  "scripts": {
    "format": "ultracite fix .",
    "format:icons": "ultracite fix ./src/icons.tsx",
    "check": "ultracite check ."
  }
}

Reference it in your Denji config:

denji.json
{
  "hooks": {
    "postAdd": ["npm run format:icons"]
  }
}

Diagnostic Levels

Filter checks by severity:

# Only errors
npx ultracite check --diagnostic-level error ./src/icons.tsx

# Errors and warnings
npx ultracite check --diagnostic-level warning ./src/icons.tsx

# All diagnostics
npx ultracite check --diagnostic-level hint ./src/icons.tsx

Use in hooks:

denji.json
{
  "hooks": {
    "preAdd": [
      "npx ultracite check --diagnostic-level error ./src/icons.tsx"
    ]
  }
}

Migration from ESLint/Prettier

Step 1: Remove Old Tools

npm uninstall eslint prettier @typescript-eslint/parser @typescript-eslint/eslint-plugin

Step 2: Install Ultracite

npm install -D ultracite

Step 3: Update Denji Config

denji.json
{
  "hooks": {
    "postAdd": [
      "npx ultracite fix ./src/icons.tsx"
    ]
  }
}

Step 4: Update Package Scripts

package.json
{
  "scripts": {
    "format": "ultracite fix .",
    "lint": "ultracite check .",
    "check": "ultracite check ."
  }
}

Step 5: Run Doctor

Verify everything is set up correctly:

npx ultracite doctor

Performance Tips

  1. Target specific files - Avoid unnecessary scanning:

    "postAdd": ["npx ultracite fix ./src/icons.tsx"]
  2. Use check for validation - Faster when you don't need fixes:

    "preAdd": ["npx ultracite check ./src/icons.tsx"]
  3. Filter diagnostics - Only show errors in CI:

    npx ultracite check --diagnostic-level error

Troubleshooting

Ultracite Not Found

Install Ultracite as a dev dependency:

npm install -D ultracite

No Linter Detected

Run the doctor command to diagnose:

npx ultracite doctor

Ultracite will suggest which configuration file to create.

Hook Fails on First Run

If the icons file doesn't exist yet, Ultracite may fail. Ensure the file exists before running:

{
  "hooks": {
    "postAdd": [
      "npx ultracite fix ./src/icons.tsx"
    ]
  }
}

Unsafe Fixes Required

Some issues require unsafe fixes. Review the output and decide:

npx ultracite fix --unsafe ./src/icons.tsx

Different Linter Needed

Specify which linter to use:

npx ultracite fix --linter eslint ./src/icons.tsx

Ultracite vs Direct Tooling

FeatureUltraciteBiomeESLint + PrettierOxlint + Oxfmt
Setupnpx ultracite initManual configComplex configManual setup
Config RequiredZeroMinimalExtensiveMinimal
Speed (Biome)Very fastVery fastN/AN/A
Speed (ESLint)FastN/ABaselineN/A
Speed (Oxlint)Extremely fastN/AN/AExtremely fast
OpinionatedHighlyModeratelyFlexibleMinimal
Type SafetyMaximumHighConfigurableGrowing
Toolchain Choice3 optionsN/AN/AN/A
Setup Time< 1 minute~5 minutes~30 minutes~10 minutes

Choose Ultracite for zero-config setup with maximum type safety and multiple toolchain options. Choose direct tooling (Biome, ESLint, or Oxlint) if you need granular control over every configuration detail.

Code Standards

Ultracite enforces strict, opinionated standards optimized for modern development. See the Ultracite documentation.

On this page