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
0a9c433
feat: Add--no-warn-ignored
CLI option for flat config (#17569) (Domantas Petrauskas)977e67e
feat: logical-assignment-operators to report expressions with 3 operands (#17600) (Yosuke Ota)
Bug Fixes
f976b2f
fix: make rule severity case-sensitive in flat config (#17619) (Milos Djermanovic)0edfe36
fix: Ensure crash error messages are not duplicated (#17584) (Nicholas C. Zakas)dd79abc
fix:eslint-disable
to be able to parse quoted rule names (#17612) (Yosuke Ota)d2f6801
fix: Ensure correct code path for && followed by ?? (#17618) (Nicholas C. Zakas)
Documentation
ee5be81
docs: default tosourceType: "module"
in rule examples (#17615) (Francesco Trotta)1aa26df
docs: Add more examples for multiline-ternary (#17610) (George Ashiotis)47d0b44
docs: Update README (GitHub Actions Bot)dbf831e
docs: use generated og image (#17601) (Percy Ma)1866da5
docs: Update README (GitHub Actions Bot)
Chores
1ef39ea
chore: upgrade @eslint/js@8.51.0 (#17624) (Milos Djermanovic)f8c7403
chore: package.json update for @eslint/js release (ESLint Jenkins)2665552
test: fix flat config linter tests to use Linter in flat config mode (#17616) (Milos Djermanovic)7b77bcc
chore: Refactor CodePathState (#17510) (Nicholas C. Zakas)bc77c9a
chore: Document and refactor ForkContext (#17566) (Nicholas C. Zakas)24e1f14
chore: Refactor and document CodePath (#17558) (Nicholas C. Zakas)