How can a lint gate be green and wrong?
The radar flagged a theme I'd been circling for weeks: linters that pass in CI and then fail where it costs something. The usual answer blames the rules. I think the rules are mostly fine. What fails is the plumbing between "the rule exists" and "the rule ran on this file and its verdict reached the exit code". So I built a sandbox and broke the plumbing on purpose.
Three files. src/app.js with a for loop missing its braces. src/handler.ts with an any parameter, a non-null assertion, a braceless if, and a misspelled undefned. lib/legacy.js with an unused function referencing an undefined x. ESLint 9.39.1, typescript-eslint 8.46.0, TypeScript 5.9.3, all installed fresh. Every claim below is one of those runs.
Gap one: why was the file never linted?
My first flat config had js.configs.recommended plus one block with files: ["**/*.js"]. Then eslint .:
lib/legacy.js 2 errors (no-unused-vars, no-undef)
src/app.js 1 error (curly)
3 problems, exit 1
Red, which looks like the green-or-red check working. Now read what's missing. src/handler.ts isn't in the output at all. Not linted, not mentioned, four defects untouched. ESLint 9's flat config only lints files that match some files pattern, and nothing in mine matched .ts. If app.js had been clean, this run exits 0.
Pass the file explicitly and ESLint is honest about it:
src/handler.ts 0:0 warning File ignored because no matching configuration was supplied
1 problem (0 errors, 1 warning), exit 0
A warning, and exit 0. The one time the tool tells you it skipped a file is the one invocation nobody uses in CI, because CI lints directories.
Is that a bug in ESLint? No, it's the documented contract. It's just a contract that makes "lint passed" and "lint looked" two different sentences.
Gap two: why was a warning counted as a pass?
Next config: same rules, every severity set to warn. Result on all three files:
3 problems (0 errors, 3 warnings), exit 0
Green. Add --max-warnings 0 and the same run prints ESLint found too many warnings (maximum: 0) and exits 1. Add --quiet instead and the warnings vanish from the output entirely while the exit code stays 0.
The monorepo this blog is built in has a root lint script with no --max-warnings flag. When I ran it for this piece it reported 1,221 problems, 1,053 errors and 168 warnings, in about 20 seconds. Those 168 would pass a CI job that ran the script as written. The 1,053 wouldn't, except that, as I found the last time I counted, nothing in CI runs the script at all.
Test retries are the same trick with a different knob: a retry count that hides red without anyone reading the first failure. Warnings are a fine idea for a rule you're trialling. They're a terrible idea for a gate, because a gate that can't fail isn't one.
Gap three: what if the rule ran and was silenced?
Third config: typescript-eslint's strict preset, so .ts files are now in scope. handler.ts finally reports:
src/handler.ts
1:29 error Unexpected any @typescript-eslint/no-explicit-any
2:16 error Forbidden non-null assertion @typescript-eslint/no-non-null-assertion
3:13 error Expected { after 'if' condition curly
Then I put /* eslint-disable */ on line 1. All three lines are gone from the output. The run still exits 1, but only because app.js and legacy.js are still broken; the file I "fixed" contributes nothing, and nothing in the report says a file-wide disable exists.
I went looking for this one in the monorepo and didn't find it. Forty eslint-disable directives across the sources, and every one of them names a rule. That's the right shape, and I'll take the small win. The reason it matters: a named disable turns off one rule in one place, while a blanket one opts the file out of every rule you add next year. Blanket disables don't age; they compound, and the creep covered earlier is the same mechanism at a larger scale.
Lint passed and lint looked are two different sentences, and most CI jobs only check the first.
Gap four: what if the right tool wasn't in the chain?
Look back at that strict-preset output. Three errors on handler.ts, and none of them is undefned. typescript-eslint turns no-undef off for TypeScript files, deliberately, because the compiler does that job with full type information. So the misspelling sails through lint.
Then: tsc --noEmit --strict src/handler.ts.
src/handler.ts(4,10): error TS2552: Cannot find name 'undefned'. Did you mean 'undefined'?
One line, correct, with a suggestion. A pipeline that runs ESLint and skips tsc because "lint is green" has a hole the exact shape of the thing most likely to reach production: a name that doesn't exist. That's not a gap in ESLint. It's a gap in treating one gate as if it were the whole pipeline. Security scanners have the same hole, and I counted it per CWE.
The trap that wasn't
I expected the --cache flag to be gap five. The story writes itself: lint with a loose config, cache the clean result, tighten the config, lint again, cache says clean. So I tried it. Linted with --cache under a config with no rules, exit 0. Replaced the config with recommended plus curly, ran again with the same cache file. Five problems, exit 1.
ESLint's cache key includes the configuration. A changed config invalidates it. I'm reporting this because I was wrong, and because the gaps that are real deserve not to be padded with ones that aren't.
Where does strictness come into it?
Here's the connection to a second theme the radar raised, the cost of a strict analyzer's false positives, and it's the part I hold an opinion on.
Every gap above has a human origin. Nobody writes files: ["**/*.js"] out of malice; they wrote it when the repo was JavaScript. Nobody sets a rule to warn for fun; they did it because the rule fired 400 times on day one and 390 of them were noise. A blanket disable goes in the day a type-aware rule flags a pattern that was correct. When I ran Biome on this monorepo it raised 1,539 findings on .astro files that weren't findings at all, and the only workable response was an override that excluded them. That's a false-positive bill paid in config, and every line of that config is a place where a future real finding can go to die.
So the cost of strictness isn't the time to read the warnings. It's that each false positive buys a loosening, and loosenings outlive the rule that caused them. A gate assembled that way tends toward green regardless of the code, which is a worse state than having no gate, because no gate at least doesn't claim anything.
What would I check in your pipeline this week?
Not a framework. A list, in the order I'd run it:
- Run
eslintby hand on one file of every extension you ship. A lint check that skips a file only says so when you name the file, and "File ignored because no matching configuration was supplied" is the tell for gap one. - Add
--max-warnings 0to the CI invocation, or stop usingwarnfor anything you'd want to block. Pick one. - Grep for
eslint-disablewith nothing after it. Each hit is a file that has opted out of every future rule. - Confirm
tsc --noEmitruns somewhere a merge depends on. Lint doesn't cover names, and it doesn't cover whether a package exists either, which matters once a model proposes imports nobody registered until now. - When a rule produces a flood on day one, decide per rule: fix, or turn it off in the config with a comment. Don't demote it to a warning. A warning is a decision deferred to nobody.
Which of these would your pipeline fail today? I'd guess at least one, because this monorepo's did. If you want a quick first pass, the CI gate audit reads a pipeline file in your browser.