Search documentation

Search all pages, headings and text, in the current package or topic or in all documentation.

eslint-config

The shared ESLint presets of the Active packages, for Node and tooling code, React libraries and Next.js applications.

@workspace/eslint-config 2.2.0Developmentunreleased, in development in Foundationbaseline ce081dc3

@workspace/eslint-config is the lint half of the shared development basis. It holds ESLint 10 flat-config presets: one baseline for every kind of code, two React specialisations built on it, and an optional plugin for a resource data layer. Your repository imports a preset in its eslint.config.mjs and adds only what is its own.

The package decides which rules run and how they report. Your repository decides when a lint run fails, through the warning threshold in its lint script. Read both halves before you trust a green run.

What the presets check#

CategoryComes fromIn which presets
JavaScript correctness@eslint/js recommended rulesall
TypeScripttypescript-eslint recommended rules, without type informationall
Unused codeno-unused-vars, with names that start with _ allowedall
No conflict with the formattereslint-config-prettier switches every formatting rule offall
Environment variablesturbo/no-undeclared-env-vars: every variable a file reads is in turbo.jsonall
Text and naming conventionsno em-dash (U+2014) in JSX text; a catch binding is err, not e or errorall, except in test files
React correctness and DOM safetya curated set of @eslint-react rulesreact-internal, next-js
Rules of hookseslint-plugin-react-hooks recommended rulesreact-internal, next-js
Next.js@next/eslint-plugin-next recommended and Core Web Vitals rulesnext-js
A resource data layerresources/select-required and resources/no-raw-where-spreadonly where you wire resource-rules

Test files (__tests__/, *.test.*, *.spec.*) may use any and are exempt from the text and naming conventions.

This is an overview by category, not a rule list. The exact rules are in the package itself: its README.md and docs/API.md travel with every copy, and Checks and troubleshooting shows how to print the rules ESLint applies to a file.

Every finding is a warning#

The presets include eslint-plugin-only-warn, which reports every rule as a warning. That includes the rules the presets configure as error, and the rules your own repository adds. Nothing in a lint run is reported as an error, except a file ESLint cannot parse.

So a lint run fails in three cases only:

SituationExit code
more warnings than --max-warnings allows1
a file that does not parse1
a configuration ESLint cannot load2

A passing lint run does not mean zero findings. With the usual threshold of 100, a run with 100 warnings passes. Read the count in the summary line, and fix the warnings your own work introduces: the room under the threshold is not permission.

The package and your repository#

The package decidesYour repository decides
the rules of each preset and their optionswhich preset each package or app imports
that every finding is a warningthe --max-warnings threshold in each lint script
the files every preset ignores (dist/, and the Next.js output in next-js)its own ignores, and stricter or tool-specific rules in a trailing block
the plugins and their versions (dependencies of the package)the eslint and typescript versions it installs
the resource rules themselvesthe files they apply to
nothing about how often lint runsthe scripts and checks that run lint, and what they require

The shared development standard sets the threshold at 100 for every lint script and lists what a repository may add; see Local additions.

How you receive it#

eslint-config is maintained in Foundation and reaches your repository by managed source transfer, on its own or in the same set as other packages. It is in development: no version of it is recorded as a release in Foundation, so it comes on the development channel. See Getting started.

What it does not do#

  • No formatting. Whitespace, quotes and import order are Prettier's; see the development basis.
  • No type checking. The TypeScript rules run without type information, so lint needs no tsconfig. Types are checked by tsc with typescript-config.
  • No legacy configuration. Flat config only; an .eslintrc file is not read.

This page as Markdown