
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 theallow
array:"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
dcd95aa
feat: support TypeScript syntax in no-empty-function rule (#19551) (sethamus)77d6d5b
feat: support TS syntax inno-unused-expressions
(#19564) (Sweta Tanwar)90228e5
feat: supportJSRuleDefinition
type (#19604) (루밀LuMir)59ba6b7
feat: add allowObjects option to no-restricted-properties (#19607) (sethamus)db650a0
feat: support TypeScript syntax inno-invalid-this
rule (#19532) (Tanuj Kanti)9535cff
feat: support TS syntax inno-loop-func
(#19559) (Nitin Kumar)
Bug Fixes
Documentation
ca7a735
docs: updateno-undef-init
when not to use section (#19624) (Tanuj Kanti)1b870c9
docs: useeslint-config-xo
in the getting started guide (#19629) (Nitin Kumar)5d4af16
docs: add types for multiple rule options (#19616) (Tanuj Kanti)e8f8d57
docs: Update README (GitHub Actions Bot)a40348f
docs: no-use-before-define tweaks (#19622) (Kirk Waiblinger)0ba3ae3
docs: Update README (GitHub Actions Bot)865dbfe
docs: ensure “learn more” deprecation links point to useful resource (#19590) (Kirk Waiblinger)f80b746
docs: add known limitations for no-self-compare (#19612) (Nitin Kumar)865aed6
docs: Update README (GitHub Actions Bot)
Chores
88dc196
chore: upgrade @eslint/js@9.25.0 (#19636) (Milos Djermanovic)345288d
chore: package.json update for @eslint/js release (Jenkins)affe6be
chore: upgrade trunk (#19628) (sethamus)dd20cf2
test: fixno-loop-func
test with duplicate variable reports (#19610) (Milos Djermanovic)bd05397
chore: upgrade@eslint/*
dependencies (#19606) (Milos Djermanovic)22ea18b
chore: replace invalidint
type withnumber
inside JSDocs. (#19597) (Arya Emami)