eslint-config-auditor
v3.0.0
Published
Shareable ESLint flat config to help you write clear, efficient JavaScript code.
Maintainers
Readme
Shareable ESLint flat config to help you write clear, efficient JavaScript code.
eslint-config-auditor

Auditor uses sane defaults focused on code readability. The Auditor's philosophy is that good code means easy to understand code.
Along with its own rules, Auditor by default includes widely-used rules from eslint-plugin-import-x, eslint-plugin-promise, and eslint-plugin-n. Auditor lints both browser and Node.js code.
Besides linting standard JavaScript code gracefully, Auditor also has first-class support for React, Jest, and TypeScript. See rules about usage.
Version 2.0.0 targets ESLint 10+ and the flat config format (eslint.config.js). All plugins ship as regular dependencies, so installing this package is all you need. The formatting/stylistic rules are provided through @stylistic/eslint-plugin under the @stylistic/ namespace (ESLint deprecated and is removing these from core).
Installation
npm install --save-dev eslint eslint-config-auditorRequires ESLint >=10 and Node.js ^20.19.0 || ^22.13.0 || >=24.
Usage
In your eslint.config.js (or eslint.config.mjs):
import auditor from 'eslint-config-auditor';
export default [...auditor];The default export is the equivalent of the old root config: recommended + finest combined.
CommonJS (eslint.config.cjs) works too:
const auditor = require('eslint-config-auditor').default;
module.exports = [...auditor];Rules
Auditor has two main rule configs, available as named exports and subpath imports:
recommendedall the needed rules to write concise JavaScript. Includes all best-practices, Node.js, import, and promise rules. Recommended for most users.finestAuditor at its finest. Strict rules for advanced use cases such as code refactors and open-source software where code changes can break infinite clients. Use it on top ofrecommended.
// eslint.config.js
import recommended from 'eslint-config-auditor/recommended';
import finest from 'eslint-config-auditor/finest';
export default [...recommended, ...finest];Formatting (opt-in)
Formatting/stylistic rules are not part of the default config; most projects
format with Biome or Prettier, and duplicating that in ESLint just creates noise
and conflicts. Opt in with eslint-config-auditor/stylistic only if you want
ESLint to own formatting too:
// eslint.config.js: quality rules + ESLint-owned formatting
import auditor from 'eslint-config-auditor';
import stylistic from 'eslint-config-auditor/stylistic';
export default [...auditor, ...stylistic];The stylistic config (a hardened superset of the
Extension.js house style) enforces: 2-space indent,
single quotes, double quotes in JSX, 80-column lines, no semicolons, no
trailing commas, no spaces inside { }, always-parenthesized arrow params
((x) => x), and blank lines surrounding every if block.
finest additionally caps files at 350 lines of code (blank lines and
comments excluded). Files that are routinely large by nature are exempt: config
files (*.config.*), type declarations (*.d.ts), generated files
(*.generated.*, generated/**), JSON, and test/spec files (*.test.*,
*.spec.*, __tests__/**, __spec__/**).
Auditor also offers first-class support for Jest, React, and TypeScript but since these are opinionated tools, you need to activate them manually.
Jest
Uses eslint-plugin-jest (already included).
// eslint.config.js
import auditor from 'eslint-config-auditor';
import jest from 'eslint-config-auditor/jest';
export default [
...auditor,
// Scope Jest rules to your test files
...jest.map((config) => ({
...config,
files: ['**/*.test.{js,jsx,ts,tsx}', '**/*.spec.{js,jsx,ts,tsx}'],
})),
];Vitest
Uses @vitest/eslint-plugin (already included). Includes the Vitest test globals (describe/it/expect/vi/…), so scope it to your test files just like Jest:
// eslint.config.js
import auditor from 'eslint-config-auditor';
import vitest from 'eslint-config-auditor/vitest';
export default [
...auditor,
// Scope Vitest rules + globals to your test files
...vitest.map((config) => ({
...config,
files: ['**/*.test.{js,jsx,ts,tsx}', '**/*.spec.{js,jsx,ts,tsx}'],
})),
];React
Uses @eslint-react/eslint-plugin (correctness-focused React rules, including rules-of-hooks and exhaustive-deps) and eslint-plugin-jsx-a11y (already included). Fully ESLint 10 native — it replaces eslint-plugin-react, which calls context.getFilename()/getScope() (removed in ESLint 10) and throws there.
[!NOTE]
reactandnextare ESM-only.@eslint-react/eslint-pluginships as an ESM-only package, so these two presets are published as ESM-only subpaths. Import them from an ESM config (eslint.config.jsin a"type": "module"project, oreslint.config.mjs). Every other preset remains dual ESM + CommonJS.
// eslint.config.mjs
import auditor from 'eslint-config-auditor';
import react from 'eslint-config-auditor/react';
export default [...auditor, ...react];Next.js
Extends the react preset with the official @next/eslint-plugin-next recommended and core-web-vitals rules (already included). ESM-only, like react.
// eslint.config.mjs
import auditor from 'eslint-config-auditor';
import next from 'eslint-config-auditor/next';
export default [...auditor, ...next];TypeScript
Uses typescript-eslint and eslint-plugin-import-x (already included). Rules are scoped to **/*.ts/**/*.tsx files and use the project service for type-aware linting, so a tsconfig.json in your project root is all you need.
The base config (recommended/finest) only attaches to JavaScript files, so a TypeScript project must include this config for its .ts/.tsx files to be linted at all. The eslint-config-auditor/ts preset bundles recommended + finest + typescript so you can do it in one import:
// eslint.config.js
import ts from 'eslint-config-auditor/ts';
export default ts;Or compose it yourself:
// eslint.config.js
import auditor from 'eslint-config-auditor';
import typescript from 'eslint-config-auditor/typescript';
export default [...auditor, ...typescript];See CONSUMING.md for copy-paste recipes per project type (JS, TS, React, Next.js, Jest, Biome coexistence) and notes on projectService.
All variants can also be pulled from the root entry as named exports:
import { recommended, finest, jest, vitest, react, stylistic, ts, typescript, typescriptChecked } from 'eslint-config-auditor';Migrating from 0.x
Version 0.x shipped legacy .eslintrc configs for ESLint 8. Version 1.0.0 is a flat-config rewrite for ESLint 9. To migrate:
Upgrade to
eslint@>=9and remove the plugin packages you installed manually for 0.x (eslint-plugin-import,eslint-plugin-promise,eslint-plugin-node,eslint-plugin-jest,eslint-plugin-react,eslint-plugin-react-hooks,eslint-plugin-jsx-a11y,@typescript-eslint/parser,@typescript-eslint/eslint-plugin). They are now bundled as dependencies of this package.Replace your
.eslintrc/.eslintrc.jsonwith aneslint.config.js:- { "extends": ["auditor", "auditor/react"] }// eslint.config.js import auditor from 'eslint-config-auditor'; import react from 'eslint-config-auditor/react'; export default [...auditor, ...react];Note these behavioral changes:
eslint-plugin-nodewas replaced by its maintained forkeslint-plugin-n. Thenode/rule prefix is preserved, so inline directives like// eslint-disable-next-line node/no-synckeep working.node/shebangis nownode/hashbang.@typescript-eslint/parser+@typescript-eslint/eslint-pluginwere replaced bytypescript-eslintv8. The TypeScript config now usesprojectService: trueinstead ofparserOptions.projectglobs.- Environments (
env) andparserOptionswere translated tolanguageOptions, with globals provided by theglobalspackage. - A few rules were removed or renamed upstream. See MIGRATION.md for the complete old-rule → disposition table.
License
MIT (c) Cezar Augusto.
