CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-oxlint

High-performance JavaScript and TypeScript linter written in Rust, designed as part of the Oxc (Oxidation Compiler) suite of tools

Overview
Eval results
Files

cli.mddocs/

Command Line Interface

Oxlint provides a comprehensive command-line interface for linting JavaScript and TypeScript files with extensive configuration options.

Basic Syntax

oxlint [OPTIONS] [PATH...]

Parameters:

  • PATH... - Files or directories to lint (defaults to current directory)

Core Options

Basic Configuration

# Configuration file (JSON only, comments supported)
oxlint --config .oxlintrc.json
oxlint -c path/to/config.json

# TypeScript configuration for path aliases and project references
oxlint --tsconfig ./tsconfig.json

# Initialize configuration with defaults
oxlint --init

Rule Management

# Allow rules or categories (suppress linting)
oxlint --allow RULE_OR_CATEGORY
oxlint -A RULE_OR_CATEGORY

# Warn on rules or categories
oxlint --warn RULE_OR_CATEGORY
oxlint -W RULE_OR_CATEGORY

# Deny rules or categories (error level)
oxlint --deny RULE_OR_CATEGORY
oxlint -D RULE_OR_CATEGORY

Rule Categories:

  • correctness - Code that is outright wrong or useless (default)
  • suspicious - Code that is most likely wrong or useless
  • pedantic - Strict lints with occasional false positives
  • style - Code style and idiomatic patterns
  • nursery - New lints under development
  • restriction - Prevents use of certain language features
  • all - All categories except nursery

Fix Options

# Apply safe automatic fixes
oxlint --fix

# Apply suggestion fixes (may change behavior)
oxlint --fix-suggestions

# Apply dangerous fixes and suggestions
oxlint --fix-dangerously

Output Control

# Output format selection
oxlint --format FORMAT
oxlint -f FORMAT

# Available formats: default, json, stylish, checkstyle, github, gitlab, junit, unix

# Warning handling
oxlint --quiet                    # Suppress warnings, errors only
oxlint --deny-warnings           # Treat warnings as errors
oxlint --max-warnings 10         # Maximum warning threshold

Plugin Management

# Enable plugins (off by default)
oxlint --react-plugin              # React and React Hooks rules
oxlint --import-plugin             # Import/export rules (experimental)
oxlint --jsdoc-plugin              # JSDoc rules
oxlint --jest-plugin               # Jest testing rules
oxlint --vitest-plugin             # Vitest testing rules
oxlint --jsx-a11y-plugin           # Accessibility rules
oxlint --nextjs-plugin             # Next.js specific rules
oxlint --react-perf-plugin         # React performance rules
oxlint --promise-plugin            # Promise rules
oxlint --node-plugin               # Node.js rules
oxlint --regex-plugin              # Regular expression rules
oxlint --vue-plugin                # Vue.js rules

# Disable plugins (on by default)
oxlint --disable-unicorn-plugin
oxlint --disable-oxc-plugin
oxlint --disable-typescript-plugin

Advanced Options

# Performance and threading
oxlint --threads 4               # Number of CPU threads (default: auto)
oxlint --silent                  # Suppress all output

# Type-aware linting (requires TypeScript configuration)
oxlint --type-aware

# Configuration debugging
oxlint --print-config            # Show resolved configuration
oxlint --disable-nested-config   # Disable auto config file loading

# Rule information
oxlint --rules                   # List all available rules

# Experimental features
oxlint --experimental-js-plugins  # Enable experimental JS plugins

Ignore Patterns

# Command-line ignore patterns
oxlint --ignore-pattern "**/*.test.js"
oxlint --ignore-pattern "dist/*"

# Specify custom ignore file (default: .eslintignore)
oxlint --ignore-path .myignore

# Disable all ignore file processing
oxlint --no-ignore

# Ignore file support
# Reads .oxlintignore, .eslintignore, and .gitignore files automatically

Inline Configuration

# Report unused disable directives
oxlint --report-unused-disable-directives

# Report with specific severity (allow|warn|error)
oxlint --report-unused-disable-directives-severity allow
oxlint --report-unused-disable-directives-severity warn
oxlint --report-unused-disable-directives-severity error

Usage Examples

Basic Linting

# Lint current directory with default settings
oxlint

# Lint specific files and directories
oxlint src/ test/ index.js

# Lint with configuration file
oxlint --config .oxlintrc.json src/

Rule Configuration

# Allow all rules, then deny specific categories
oxlint -A all -D correctness -D suspicious src/

# Mix of allow/deny for fine-grained control
oxlint -D suspicious --allow no-debugger -W pedantic src/

Plugin Usage

# Enable React and import plugins for React projects
oxlint --react-plugin --import-plugin --tsconfig tsconfig.json src/

# Disable default plugins for minimal linting
oxlint --disable-unicorn-plugin --disable-oxc-plugin src/

Fix and Format

# Apply safe fixes with JSON output
oxlint --fix --format json src/

# Apply all fixes including dangerous ones
oxlint --fix-dangerously src/

# GitHub Actions integration
oxlint --format github src/

CI/CD Integration

# Fail build on any warnings
oxlint --deny-warnings --format junit src/ > test-results.xml

# Set warning threshold for gradual adoption
oxlint --max-warnings 50 src/

# Quiet mode for CI (errors only)
oxlint --quiet --format checkstyle src/

Exit Codes

Success (0)

  • LintSucceeded - No errors found
  • PrintConfigResult - Configuration printed successfully
  • ConfigFileInitSucceeded - Config file created successfully
  • LintNoFilesFound - No files to lint (currently returns 0)

Failure (1)

  • LintFoundErrors - Linting errors found
  • LintMaxWarningsExceeded - Warning threshold exceeded
  • LintNoWarningsAllowed - Warnings found when --deny-warnings used
  • ConfigFileInitFailed - Failed to create config file
  • InvalidOptionConfig - Invalid configuration file
  • InvalidOptionTsConfig - Invalid tsconfig.json
  • InvalidOptionSeverityWithoutFilter - Severity option without rule filter
  • InvalidOptionSeverityWithoutPluginName - Severity without plugin name
  • InvalidOptionSeverityWithoutRuleName - Severity without rule name
  • TsGoLintError - Type-aware linting error

Environment Variables

# Control logging levels and targets for debugging
OXC_LOG=oxc_resolver oxlint --import-plugin src/
OXC_LOG=debug oxlint src/

# Version override (build-time only)
OXC_VERSION=custom-build

File Extensions

Supported file extensions:

  • JavaScript: .js, .mjs, .cjs, .jsx
  • TypeScript: .ts, .mts, .cts, .tsx
  • Vue: .vue (requires --vue-plugin)
  • Svelte: .svelte (basic support)
  • Astro: .astro (basic support)

Install with Tessl CLI

npx tessl i tessl/npm-oxlint

docs

cli.md

configuration.md

index.md

nodejs-api.md

output-formats.md

plugins.md

rules.md

tile.json