Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[no-unused-vars] False positives with members of exported namespace in .d.ts file #2867

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@andersk

Description

@andersk
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I haveread the FAQ and my problem is not listed.

Repro

{"parser":"@typescript-eslint/parser","plugins": ["@typescript-eslint"],"rules": {"@typescript-eslint/no-unused-vars":"error"  }}
// foo.d.tsexportnamespaceFoo{constbar:string;namespaceBaz{constquux:string;}}

Expected Result

No error. In a.d.ts file, members of an exported namespace are implicitly exported, unless the namespace contains an explicit bracedexport {} declaration.

Actual Result

/tmp/test/foo.d.ts  2:9   error  'bar' is defined but never used   @typescript-eslint/no-unused-vars  3:13  error  'Baz' is defined but never used   @typescript-eslint/no-unused-vars  4:11  error  'quux' is defined but never used  @typescript-eslint/no-unused-vars✖ 3 problems (3 errors, 0 warnings)

Additional Info

Similar to#2456, which was about a different kind of implicit export in.d.ts files, namely interface declarations.

Versions

packageversion
@typescript-eslint/eslint-plugin4.9.1
@typescript-eslint/parser4.9.1
TypeScript4.1.2
ESLint7.15.0
node14.15.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp