eslint-config-no-warn
Every rule in the RESOLVED ESLint config is
errororoff, neverwarn, including severities a spread preset injects.
Runs under: @noctcore/harness lint-meta, not ESLint · Factory: createEslintConfigNoWarnRule from @noctcore/lint-meta-rules/resolved-config · Category: config · Fails CI by default: yes
Import it from the resolved-config entry point, which (unlike the main one) loads ESLint:
import { createEslintConfigNoWarnRule } from '@noctcore/lint-meta-rules/resolved-config';A warn neither fails CI nor gets fixed. no-warn-severity scans config
TEXT for a 'warn' literal, which misses the common case: a preset spread into the config
(...reactHooks.configs['recommended-latest']) ships rules at warn, and no file the project owns
spells the word. This rule asks ESLint itself. It resolves each package’s effective flat config with
calculateConfigForFile and reports every rule that ends up at severity 1, however it got there.
Use both: the text scan is instant and runs anywhere; this one is the one a preset cannot slip past.
What it flags
Section titled “What it flags”For every directory matched by packages that holds one of configFiles, it resolves the config for
each of probes (glob matching only, so the probe files need not exist) and reports, once per rule
id, every rule whose resolved severity is warn (1, 'warn', or ['warn', ...]).
It fails closed:
- a config that cannot be loaded (a missing import, an unbuilt workspace package) is a violation;
- a probe whose resolution THROWS is a violation even when another probe resolves, so a config that breaks for one file shape cannot pass on the shapes that still work;
- a package whose config ignores every probe is a violation, since nothing was checked.
Async: it implements the harness’s runAsync (@noctcore/harness 0.3.0 or newer).
What it does not flag
Section titled “What it does not flag”- A probe that is merely ignored, while another probe resolves.
- A preset
warnthat a later block overrides toerrororoff: only the resolved severity counts. - A directory matched by
packagesthat holds none ofconfigFiles(it inherits a config it does not own). - Blocks scoped to a file shape no probe matches (
.vue,e2e/**) until you add a probe for it.
Options
Section titled “Options”createEslintConfigNoWarnRule(options?: EslintConfigNoWarnOptions): IMetaRule| Option | Type | Default | Meaning |
|---|---|---|---|
id |
string |
'eslint-config-no-warn' |
Rule id, for running more than one instance. |
packages |
string[] |
['.', 'apps/*', 'packages/*'] |
Directories whose config is resolved: globs, or . for the root. A match is checked only when it holds one of configFiles. |
configFiles |
string[] |
['eslint.config.js', 'eslint.config.mjs', 'eslint.config.cjs'] |
File names that mark a directory as owning a flat config. The first one present names the violation’s file. |
probes |
string[] |
src/__lint_meta_probe__.{ts,tsx,test.ts,test.tsx} |
Files, relative to each package, the config is resolved for. Add one per file shape your config scopes blocks to (.js, .vue, e2e/**). |
ciCritical |
boolean |
true |
Whether a violation fails CI. |
Worked example: a pnpm monorepo
Section titled “Worked example: a pnpm monorepo”A layout where every app and package owns a config built from a shared @repo/eslint-config, and the
root config only lints tooling:
createEslintConfigNoWarnRule({ packages: ['apps/*', 'packages/*'] });Deleting the three react-hooks/* overrides from the shared React config (so the
recommended-latest preset’s warn shows through, with no warn literal anywhere) reports three
rules in each of the three packages that spread it.
- The rule resolves with the
eslintthat@noctcore/lint-meta-rulesresolves, which is the consumer’s own install when it is hoisted. - If a config imports a workspace package that must be built first, build it before lint-meta, or the rule reports that the config could not be resolved.
When not to use it
Section titled “When not to use it”If your repo has no flat ESLint config per package, or you cannot build the workspace packages a
config imports before lint-meta runs, rely on no-warn-severity alone.