
Highlights
Explicit resource management support in core rules
Four core rules have been updated to better support explicit resource management, a new feature in ES2026 JavaScript, including support for using
and await using
syntax.
The init-declarations
rule no longer reports on initializing using
and await using
variables when the option is "never"
, because these variables must be initialized. For example:
async function foobar() {
await using quux = getSomething();
}
The no-const-assign
rule now reports on modifying using
and await using
variables. For example:
if (foo) {
using a = getSomething();
a = somethingElse;
}
The no-loop-func
rule no longer reports on references to using
and await using
variables, because these variables are constant. For example:
for (using i of foo) {
var a = function() { return i; }; // OK, all references are referring to block scoped variables in the loop.
a();
}
The no-undef-init
rule no longer reports on using
and await using
variables initialized to undefined
. For example:
using foo = undefined;
Improved RuleTester
output for incorrect locations
The run
method of the RuleTester
class has been enhanced to indicate when multiple properties of a reported error location in a test case do not match. For example:
AssertionError [ERR_ASSERTION]: Actual error location does not match expected error location.
+ actual - expected
{
+ column: 31,
+ endColumn: 32
- column: 32,
- endColumn: 33
}
Previously, the output would only show one property even if there were multiple mismatches:
AssertionError [ERR_ASSERTION]: Error column should be 32
31 !== 32
+ expected - actual
-31
+32
Features
35cf44c
feat: output full actual location in rule tester if different (#19904) (ST-DDT)a6a6325
feat: support explicit resource management inno-loop-func
(#19895) (Milos Djermanovic)4682cdc
feat: support explicit resource management inno-undef-init
(#19894) (Milos Djermanovic)5848216
feat: support explicit resource management ininit-declarations
(#19893) (Milos Djermanovic)bb370b8
feat: support explicit resource management inno-const-assign
(#19892) (Milos Djermanovic)
Bug Fixes
07fac6c
fix: retry on EMFILE when writing autofix results (#19926) (TKDev7)28cc7ab
fix: Remove incorrect RuleContext types (#19910) (Nicholas C. Zakas)
Documentation
664cb44
docs: Update README (GitHub Actions Bot)40dbe2a
docs: fix mismatch betweenglobalIgnores()
code and text (#19914) (MaoShizhong)5a0069d
docs: Update README (GitHub Actions Bot)fef04b5
docs: Update working on issues info (#19902) (Nicholas C. Zakas)