Skip to content

no-nonstandard-builtin-properties: Symbol.asyncDispose is incorrectly reported as non-standard #3630

Description

@Sli4o

unicorn/no-nonstandard-builtin-properties reports Symbol.asyncDispose as a non-standard property of Symbol.

Symbol.asyncDispose is part of the ECMAScript standard as part of Explicit Resource Management, so I would expect it to be included in the rule's static list of standard built-in properties.

The rule documentation states that:

The static list tracks the latest published ECMAScript edition and selected web-standard built-ins, not runtime-specific extensions or separate proposal drafts.

Example:

const asyncDispose = Symbol.asyncDispose;

Currently reports:

`asyncDispose` is not a standard property of `Symbol`. unicorn/no-nonstandard-builtin-properties

The same issue occurs when implementing an async disposable resource in TypeScript:

type TemporaryDirectory = {
    path: string;
    [Symbol.asyncDispose](): Promise<void>;
};

Expected behavior: No error should be reported for Symbol.asyncDispose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions