
Highlights
Support for tokens and comments in SourceCode
Rule authors often work with ESLint’s SourceCode object, which represents the JavaScript source code being linted. Its getText(), getLoc(), and getRange() methods have always accepted a node, token, or comment, but the documentation didn’t describe every argument type, and the type definitions rejected some valid calls, such as passing a comment.
This release updates the documentation and type definitions to match the actual behavior. This also aligns these methods with implementations of the core SourceCodeBase interface used in language plugins. Code that calls these methods is unaffected, but TypeScript code that implements or mocks SourceCode may need its getText(), getLoc(), and getRange() signatures updated to accept tokens and comments.
Rule fixes
The following rules have been updated to work correctly in certain edge cases, including autofix behavior and the handling of supplementary Unicode characters in code:
consistent-returnmax-lines-per-functionnew-capno-evalno-invalid-thisno-loss-of-precisionprefer-arrow-callbackprefer-exponentiation-operator
Features
4618052feat: handle astral letters innew-cap(#21357) (sary)4ec5168feat: allowSourceCode#getText()to accept tokens and comments (#21340) (electrohyun)
Bug Fixes
bc51eeefix:prefer-arrow-callbackfalse positive in conditional test (#21373) (Daniel Pinto)bbff86cfix: skip lines with multiple comments inmax-lines-per-function(#21332) (xbinaryx)efc4d6bfix: astral letters inconsistent-return,no-eval,no-invalid-this(#21360) (lumir)93de066fix: prefer-exponentiation-operator autofix for async function base (#21322) (Vladimir Babin)02e34fffix: add missing space afterelseincurlyautofix (#21355) (Pixel)b14b8bcfix: correctid-lengthmessage for long private names (#21348) (Pixel)69aac01fix: supportTSFunctionTypeingetFunctionHeadLoc(#21335) (xbinaryx)686630efix:no-loss-of-precisionfalse positive with0.e5(#21337) (sethamus)
Documentation
67eb586docs: Update README (GitHub Actions Bot)5370d7edocs: clarifyone-varseparateRequiresmatches anyrequire()call (#21192) (sethamus)8816c1ddocs: Update README (GitHub Actions Bot)3d2e7cedocs: fix typo in no-unused-expressions documentation (#21346) (bytedoe)
Chores
152067fchore: update ecosystem plugins (#21362) (ESLint Bot)b56d58echore: update github/codeql-action action to v4.38.2 (#21376) (renovate[bot])bfaea12perf: cache normalized config globals per languageOptions (#21364) (James Ross)322209eci: avoid Nx cache in ecosystem tests and disable failing test (#21369) (Francesco Trotta)d166567chore: update dependency prettier to v3.9.9 (#21371) (renovate[bot])29585cechore: update dependency eslint-plugin-expect-type to ^0.7.0 (#21359) (renovate[bot])39d79bachore: update github/codeql-action action to v4.38.1 (#21354) (renovate[bot])182a6e9chore: update dependency prettier to v3.9.8 (#21352) (renovate[bot])f995127chore: remove CLAUDE.md in favor of AGENTS.md (#21339) (Jarren)b95fb6cchore: update dependency prettier to v3.9.7 (#21347) (renovate[bot])3782dd4chore: update ecosystem plugins (#21342) (ESLint Bot)
