Skip to content

Getting Started

Get a complete ESLint setup in under a minute — with built-in support for AI-generated code and OxLint migration.

Installation

  1. Install the package and its peer dependencies:

    npm install -D eslint-config-setup eslint typescript
  2. Create your ESLint config file:

    // eslint.config.ts
    import { getEslintConfig } from "eslint-config-setup"
    
    export default await getEslintConfig({ react: true })
  3. Run ESLint:

    npx eslint .

NOTE

Requires ESLint >= 9.22 and TypeScript >= 5.0.

What you get

That single getEslintConfig() call gives you 27 plugins, configured and tested:

  • TypeScriptstrictTypeChecked, the strictest preset available
  • React 19 — Hooks, JSX-A11y, Storybook, Testing Library
  • Imports — cycle detection, auto-sorted, unused removal
  • Code quality — SonarJS duplicate detection, cognitive complexity
  • Security — eval, ReDoS, command injection, timing attacks
  • Browser compat — warns on APIs your browserslist targets don't support
  • Spell checking — catches typos in variable names and comments
  • RegExp — syntax validation, ReDoS prevention, modern patterns
  • JSON & Markdown — structural linting plus code block validation
  • Vitest & Playwright — test-specific rules with automatic relaxations
  • Prettier compatibility — formatting rules disabled so your formatter wins

No plugin juggling. No dependency research. No copy-pasted config blocks.

What makes this different

Built for AI-generated code

Most ESLint configs assume a human is writing the code. But when Cursor, Copilot, or Claude Code write your functions, the failure modes are different: implicit types, magic numbers, inconsistent naming, functions that grow unchecked — at machine speed.

Enable ai: true and the config adds strict guardrails that AI tools follow without complaint: explicit return types, naming conventions, complexity limits, no magic values. Rules that would slow a human down are trivial for an AI to satisfy.

export default await getEslintConfig({ react: true, ai: true })

See AI Mode for the full rule set.

Ready for OxLint

OxLint rewrites core ESLint rules in Rust — 50 to 100x faster. But migrating means figuring out which rules overlap, which don't, and keeping both configs in sync. Most teams give up and pick one.

This config does the work for you. Enable oxlint: true and every ESLint rule that OxLint already covers gets disabled automatically. getOxlintConfig() generates a matching OxLint config with the same rules at the same severity. Run both linters, get the full coverage, no conflicts.

// eslint.config.ts
export default await getEslintConfig({ react: true, oxlint: true })

// oxlint.config.ts
import { getOxlintConfig } from "eslint-config-setup"
export default await getOxlintConfig({ react: true })

See OxLint Integration for the setup guide.

Configuration flags

Enable features by setting flags to true:

export default await getEslintConfig({
  react: true,   // React 19+, Hooks, JSX-A11y, Storybook, Testing Library
  node: true,    // Node.js globals and rules
  ai: true,      // Strict rules for AI-assisted development
  oxlint: true,  // Disable rules covered by OxLint
})

Flags are independent — combine them however you need. See Configuration for details.

Customizing rules

Every config is fully customizable:

import { getEslintConfig, disableRule, addRule } from "eslint-config-setup"

const config = await getEslintConfig({ react: true, ai: true })

disableRule(config, "@typescript-eslint/no-magic-numbers", { scope: "tests" })
addRule(config, "no-console", "off", { scope: "scripts" })

export default config

See the Rule API for the full set of manipulation functions.