
Highlights
New CLI option --no-warn-ignored
This release includes a new CLI option --no-warn-ignored that, when on, suppresses warnings about ignored files that were explicitly passed in the file list. The new option is available only in the flat config mode.
This option is particularly useful when ESLint is run with --max-warnings 0 from tools that pass a list of individual files, such as lint-staged, as it prevents exit code 1 when an ignored file is passed.
{
"lint-staged": {
"*.js": "eslint --max-warnings 0 --no-warn-ignored"
}
}
API
As part of this change, FlatESLint constructor has a new option warnIgnored: boolean, default true.
The warnIgnored option of FlatESLint#lintText() is still available, but it now defaults to the value of the constructor option. Effectively, its default value is changed from false to true. In order to retain previous behavior, pass warnIgnored: false to FlatESLint#lintText():
const eslint = new FlatESLint();
await eslint.lintFiles(patterns);
await eslint.lintText(code, { filePath, warnIgnored: false });
Features
0a9c433feat: Add--no-warn-ignoredCLI option for flat config (#17569) (Domantas Petrauskas)977e67efeat: logical-assignment-operators to report expressions with 3 operands (#17600) (Yosuke Ota)
Bug Fixes
f976b2ffix: make rule severity case-sensitive in flat config (#17619) (Milos Djermanovic)0edfe36fix: Ensure crash error messages are not duplicated (#17584) (Nicholas C. Zakas)dd79abcfix:eslint-disableto be able to parse quoted rule names (#17612) (Yosuke Ota)d2f6801fix: Ensure correct code path for && followed by ?? (#17618) (Nicholas C. Zakas)
Documentation
ee5be81docs: default tosourceType: "module"in rule examples (#17615) (Francesco Trotta)1aa26dfdocs: Add more examples for multiline-ternary (#17610) (George Ashiotis)47d0b44docs: Update README (GitHub Actions Bot)dbf831edocs: use generated og image (#17601) (Percy Ma)1866da5docs: Update README (GitHub Actions Bot)
Chores
1ef39eachore: upgrade @eslint/js@8.51.0 (#17624) (Milos Djermanovic)f8c7403chore: package.json update for @eslint/js release (ESLint Jenkins)2665552test: fix flat config linter tests to use Linter in flat config mode (#17616) (Milos Djermanovic)7b77bccchore: Refactor CodePathState (#17510) (Nicholas C. Zakas)bc77c9achore: Document and refactor ForkContext (#17566) (Nicholas C. Zakas)24e1f14chore: Refactor and document CodePath (#17558) (Nicholas C. Zakas)
