oxlint-auto-configure

module
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: MIT

README

oxlint-auto-configure

Generate the optimal .oxlintrc.json — not a linter, a configurator.

This tool's one job: inspect your project and write the best possible oxlint config. It does not lint, fix, or replace oxlint — it configures oxlint so you don't have to.

Why

Oxlint has 716 rules across 7 categories and 15 plugins. Only 108 are enabled by default. Manually configuring each rule for maximum type safety is tedious and error-prone. This tool automates the entire process:

  • Discovers your project type (React, Next.js, Vue, etc.)
  • Enables relevant plugins automatically
  • Sets optimal severity for every rule based on your chosen profile
  • Generates a ready-to-use .oxlintrc.json

Scope boundary: This tool generates .oxlintrc.json. Running oxlint, auto-fixing code, and enforcing lint rules are oxlint's job. The analyze command is a diagnostic aid to help you decide which profile to use — not a replacement for running oxlint itself.

Installation

# Build and run directly (oxlint included)
nix run github:larsartmann/oxlint-auto-configure -- configure

# Or install to your nix profile
nix profile install github:larsartmann/oxlint-auto-configure

# Dev shell with go, oxlint, gopls, golangci-lint
nix develop github:larsartmann/oxlint-auto-configure
Go
export GOPRIVATE=github.com/LarsArtmann/*
go install github.com/larsartmann/oxlint-auto-configure/cmd/oxlint-auto-configure@latest

Requires Go 1.26+ and oxlint in PATH.

Note: The Go install method requires access to the private go-finding dependency. The nix method works without any Go setup or Git authentication.

Quick Start

# Generate config with recommended profile (default)
oxlint-auto-configure configure

# Maximum type safety — ALL rules at 'error'
oxlint-auto-configure configure --profile maximal-typesafe

# Dry run to see what would change
oxlint-auto-configure configure --dry-run

# Validate your existing config
oxlint-auto-configure validate

# Analyze project and show findings (SARIF output)
oxlint-auto-configure analyze

# Report of all 716 rules and their recommended severity
oxlint-auto-configure report

Profiles

Profile Correctness Suspicious TypeScript Style Perf Pedantic Restriction Nursery
maximal-typesafe error error error error error error error warn
strict error error error warn warn warn warn off
recommended error error error warn warn warn warn off
minimal error default default default default default default default
Profile Details
  • maximal-typesafe: Every single rule at error. Maximum type safety and correctness enforcement. Even nursery rules at warn.
  • strict: Core correctness at error, everything else at warn except nursery.
  • recommended (default): Correctness + suspicious + TypeScript rules at error. Style, perf, pedantic at warn. Restriction at warn. Nursery off.
  • minimal: Only correctness at error. Everything else uses oxlint defaults.

Project Detection

The tool auto-detects your project type and enables relevant plugins:

Detected Plugins Enabled
React react, jsx-a11y, react-perf
Next.js nextjs, react, jsx-a11y
Vue vue
Jest jest, node
Vitest vitest
TypeScript typescript (always on)

Commands

configure

Generate the optimal .oxlintrc.json:

oxlint-auto-configure configure [flags]
Flag Default Description
-p, --profile recommended Configuration profile
-c, --config .oxlintrc.json Output config file path
-d, --dry-run false Show changes without writing
--fix false Run oxlint --fix after writing config
--root . Project root directory
analyze

Run oxlint and show findings using the go-finding pipeline:

oxlint-auto-configure analyze [--root .] [-f summary|json|report|sarif|table]
validate

Validate an existing .oxlintrc.json:

oxlint-auto-configure validate [-c .oxlintrc.json]
report

Generate a report of all rules and recommended severities:

oxlint-auto-configure report [-p recommended] [-f table|json|summary]

Rule Statistics

Category Count Default
Correctness 216 108 enabled
Style 211 mostly disabled
Pedantic 115 disabled
Restriction 91 disabled
Suspicious 52 disabled
Perf 13 disabled
Nursery 18 disabled
Total 716 108 enabled
Plugin Rules
eslint 173
unicorn 128
typescript 108
react 57
jest 56
import 32
jsx_a11y 31
vitest 23
nextjs 21
jsdoc 18
vue 17
promise 16
oxc 26
node 6
react_perf 4

Development

GOWORK=off go test -race ./...          # Run tests with -race
GOWORK=off go vet ./...                 # Run go vet
GOWORK=off golangci-lint run ./...      # Run linter
nix build .                             # Build via nix (runs tests)
nix run . -- configure                  # Run via nix (oxlint included)
oxlint -f json --rules > pkg/rule/rules_data.json  # Refresh rules from oxlint
GOWORK=off go mod vendor                # Re-vendor deps (needed after go.mod changes)

Architecture

oxlint-auto-configure/
├── cmd/oxlint-auto-configure/   # CLI entry point
├── pkg/
│   ├── rule/                   # Rule types, registry (716 embedded rules)
│   ├── profile/                # Profiles, categorization engine
│   ├── config/                 # .oxlintrc.json generator
│   ├── detect/                 # Project type detection
│   ├── diff/                   # Config comparison
│   ├── format/                 # Findings rendering (summary, JSON, table)
│   ├── oxlint/                 # go-finding Detector for oxlint
├── internal/cli/               # CLI commands (Cobra)
└── docs/                       # Documentation

Tools Using This

License

MIT

Directories

Path Synopsis
cmd
oxlint-auto-configure command
Command oxlint-auto-configure generates optimal oxlint configurations.
Command oxlint-auto-configure generates optimal oxlint configurations.
internal
cli
Package cli implements the oxlint-auto-configure CLI commands.
Package cli implements the oxlint-auto-configure CLI commands.
pkg
config
Package config generates .oxlintrc.json configuration files.
Package config generates .oxlintrc.json configuration files.
detect
Package detect detects project type and framework usage to determine which oxlint plugins should be enabled.
Package detect detects project type and framework usage to determine which oxlint plugins should be enabled.
diff
Package diff compares two oxlint configs and shows the differences.
Package diff compares two oxlint configs and shows the differences.
format
Package format renders analysis findings in various output formats.
Package format renders analysis findings in various output formats.
oxlint
Package oxlint provides a go-finding Detector that runs oxlint and converts its JSON output to go-finding Finding values.
Package oxlint provides a go-finding Detector that runs oxlint and converts its JSON output to go-finding Finding values.
profile
Package profile defines configuration profiles and the categorization engine that maps oxlint rule categories to severity decisions.
Package profile defines configuration profiles and the categorization engine that maps oxlint rule categories to severity decisions.
rule
Package rule defines types and the registry for oxlint rules.
Package rule defines types and the registry for oxlint rules.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL