rome / tools

Unified developer tools for JavaScript, TypeScript, and the web
https://docs.rome.tools/
MIT License
23.74k stars 659 forks source link

🐛 Typescript Declaration File noUnusedVariable #3169

Closed ZachHaber closed 2 years ago

ZachHaber commented 2 years ago

Environment information

Rome Extension: v0.14.0
No Rome CLI installed globally or locally,

VSCode Env Info:
Version: 1.71.0 (system setup)
Commit: 784b0177c56c607789f9638da7b6bf3230d47a8c
Date: 2022-09-01T07:36:10.600Z
Electron: 19.0.12
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.19044
Sandboxed: No

What happened?

When viewing a manually created .d.ts file, noUnusedVariables erroneously triggers.

For reference, this is setting up an environment that's outside the normal browser environment (Adobe Acrobat), so the default typescript lib files don't apply in a lot of cases.

declare const ANSB_None: number;

interface MapConstructor {
    new <K, V>(
        iterable?:
            | Iterable<readonly [K, V] | LegacyIterator<readonly [K, V]>>
            | null,
    ): Map<K, V>;
}

declare class StopIteration {
    private constructor();
}

Playground Link (Note: there's no declaration file option in the playground)

Expected result

It should not flag these declarations as unused.

Code of Conduct

MichaReiser commented 2 years ago

@xunilrj would you mind taking a look at this

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 14 days with no activity.