
Highlights
New Parser Option
The default parser has a new option allowReserved (boolean, default false). When set to true, reserved words can be used as identifiers.
This option can only be used with "ecmaVersion": 3.
{
"parserOptions": {
"ecmaVersion": 3,
"allowReserved": true
}
}
New Features for Custom Formatters
This release adds two new features for custom formatters.
Async Formatters
Formatters are now allowed to return Promise<string>. That is, a formatter can be an async function.
//------ my-formatter.js ------
module.exports = async function(results, context) {
const something = await getSomethingAsync();
// ...
return formattedResults;
};
context.cwd
The context argument has a new property cwd (string, absolute path). It represents the working directory used for linting. This value comes from the cwd constructor option of the ESLint class, and formatters can use it to output relative paths more reliably than by using process.cwd().
//------ my-formatter.js ------
module.exports = function(results, context) {
const cwd = context.cwd;
// ...
};
Features
5771663feat: addallowReservedparser option (#15387) (Milos Djermanovic)32ac37afeat: Flat config support in Linter (refs #13481) (#15185) (Nicholas C. Zakas)d041f34feat: Treat Class/New Expressions as truthy in no-constant-condition (#15326) (Jordan Eldredge)8f44cf5feat: report only lines that exceed the limit in max-lines-per-function (#15140) (Sneh Khatri)808ad35feat: pass cwd to formatters (refs eslint/rfcs#57) (#13392) (Toru Nagashima)f1b7499feat: support async formatters (#15243) (MO)
Bug Fixes
Documentation
54deec5docs: update integrations.md (#15380) (Vlad Sholokhov)fa0423adocs: fix typo in PR template (#15365) (Nitin Kumar)e233920docs: enable a few more markdownlint rules and fix violations (#15368) (Bryan Mishkin)632176ddocs: Dedent needlessly indented example in getter-return docs (#15363) (Jordan Eldredge)4497e88docs: Update release notes blog post template (#15285) (Nicholas C. Zakas)
Chores
efede90chore: upgrade @eslint/eslintrc@1.0.5 (#15389) (Milos Djermanovic)0b8c846chore: fix update-readme to avoid multiple consecutive blank lines (#15375) (Milos Djermanovic)94b2a8bchore: Use default Chromium binary in M1 Mac tests (#15371) (Brandon Mills)ba58d94ci: use nodev16for Verify Files (#15364) (Nitin Kumar)1e32ee5chore: add jsdoc type annotation to rules (#15291) (Bryan Mishkin)

