#2175·jsdoc

Support for ECMAScript explicit resource management (using declarations)

Author: cschanhniemCreated Jun 19, 2026Updated Jun 19, 2026

Problem

JSDoc does not recognize using and await using declarations (TC39 Stage 4, ES2025), causing parsing errors or skipped documentation for code that uses the explicit resource management pattern.

Example that fails

javascript
/**
 * @returns {Promise<void>}
 */
async function example() {
  await using file = new FileHandle('data.txt');
  // ... file is automatically disposed
}
javascript
/**
 * @returns {number}
 */
function scopedResource() {
  using timer = new PerformanceTimer();
  // ... timer is automatically disposed on scope exit
  return 42;
}

Expected behavior

JSDoc should parse using and await using declarations similarly to const / let, treating the variable as declared and continuing to document any preceding JSDoc comment blocks.

Impact

As more projects adopt explicit resource management (promoted by Node.js 22+ and TypeScript 5.3+), this omission creates a growing gap. Projects using patterns like using for file handles, database connections, or timers will have incomplete or broken documentation.

I traced the parser code and believe the fix belongs in packages/jsdoc-parse/lib/ast-node.js where declaration types are mapped. The using keyword needs to be added to the recognized declaration list alongside var, let, const.