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#
| Category | Comes from | In which presets |
|---|---|---|
| JavaScript correctness | @eslint/ recommended rules | all |
| TypeScript | typescript- recommended rules, without type information | all |
| Unused code | no-, with names that start with _ allowed | all |
| No conflict with the formatter | eslint- switches every formatting rule off | all |
| Environment variables | turbo/: every variable a file reads is in turbo. | all |
| Text and naming conventions | no em-dash (U+2014) in JSX text; a catch binding is err, not e or error | all, except in test files |
| React correctness and DOM safety | a curated set of @eslint- rules | react-, next- |
| Rules of hooks | eslint- recommended rules | react-, next- |
| Next.js | @next/ recommended and Core Web Vitals rules | next- |
| A resource data layer | resources/ and resources/ | only where you wire resource- |
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:
| Situation | Exit code |
|---|---|
more warnings than --max- allows | 1 |
| a file that does not parse | 1 |
| a configuration ESLint cannot load | 2 |
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 decides | Your repository decides |
|---|---|
| the rules of each preset and their options | which preset each package or app imports |
| that every finding is a warning | the --max- threshold in each lint script |
the files every preset ignores (dist/, and the Next.js output in next-) | 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 themselves | the files they apply to |
| nothing about how often lint runs | the 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 bytscwith typescript-config. - No legacy configuration. Flat config only; an
.eslintrcfile is not read.