
Highlights
allowObjects option for no-restricted-properties
This release adds a new option allowObjects to the no-restricted-properties rule. The allowObjects option allows you to restrict a property globally but allow specific objects to use it.
/* eslint no-restricted-properties: ["error", { "property": "push", "allowObjects": ["router", "history"] } ] */
router.push('/home'); // allowed
history.push('/about'); // allowed
myArray.push("/info"); // not allowed
TypeScript Syntax Support in Core Rules
As announced in the ESLint v9.23.0 release blog post, we are actively working to add TypeScript syntax support to core rules.
ESLint v9.25.0 introduces full TypeScript syntax support for four more core rules. These rules are:
no-empty-function. This rule has new TypeScript-specific options in theallowarray:"privateConstructors","protectedConstructors","decoratedFunctions", and"overrideMethods".no-invalid-this.no-loop-func.no-unused-expressions.
These rules can now be used to lint TypeScript files as well as regular JavaScript.
To lint TypeScript code, be sure to use @typescript-eslint/parser, or another compatible parser.
Features
dcd95aafeat: support TypeScript syntax in no-empty-function rule (#19551) (sethamus)77d6d5bfeat: support TS syntax inno-unused-expressions(#19564) (Sweta Tanwar)90228e5feat: supportJSRuleDefinitiontype (#19604) (루밀LuMir)59ba6b7feat: add allowObjects option to no-restricted-properties (#19607) (sethamus)db650a0feat: support TypeScript syntax inno-invalid-thisrule (#19532) (Tanuj Kanti)9535cfffeat: support TS syntax inno-loop-func(#19559) (Nitin Kumar)
Bug Fixes
Documentation
ca7a735docs: updateno-undef-initwhen not to use section (#19624) (Tanuj Kanti)1b870c9docs: useeslint-config-xoin the getting started guide (#19629) (Nitin Kumar)5d4af16docs: add types for multiple rule options (#19616) (Tanuj Kanti)e8f8d57docs: Update README (GitHub Actions Bot)a40348fdocs: no-use-before-define tweaks (#19622) (Kirk Waiblinger)0ba3ae3docs: Update README (GitHub Actions Bot)865dbfedocs: ensure “learn more” deprecation links point to useful resource (#19590) (Kirk Waiblinger)f80b746docs: add known limitations for no-self-compare (#19612) (Nitin Kumar)865aed6docs: Update README (GitHub Actions Bot)
Chores
88dc196chore: upgrade @eslint/js@9.25.0 (#19636) (Milos Djermanovic)345288dchore: package.json update for @eslint/js release (Jenkins)affe6bechore: upgrade trunk (#19628) (sethamus)dd20cf2test: fixno-loop-functest with duplicate variable reports (#19610) (Milos Djermanovic)bd05397chore: upgrade@eslint/*dependencies (#19606) (Milos Djermanovic)22ea18bchore: replace invalidinttype withnumberinside JSDocs. (#19597) (Arya Emami)
