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

Bug: [no-useless-empty-export] false-positive for .d.ts file with only type exports #4975

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@Josh-Cena

Description

@Josh-Cena

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I havesearched for related issues and found none that matched my issue.
  • I haveread the FAQ and my problem is not listed.

Issue Description

Sigh This is supposed to be a simple reproduction, but the playground cannot treat the current file as a.d.ts file, so I have to provide a repo.

Reproduction Repository Link

https://github.com/Josh-Cena/ts-eslint-repro

Repro Steps

  1. clone the repo
  2. yarn install
  3. Go toindex.d.ts -> see that theexport {} is flagged
  4. Comment it out, and go toanother-file.d.ts -> see that I'm able to import a non-exported type.

The reason is because.d.ts files with only type exports are still seen as scripts. (microsoft/TypeScript#38592) However, when I'm developing a utility type library, I don't really want to use.ts files that only export types—using.d.ts files makes sure the file only contains typedefs, and do not need to be compiled.

I expect the rule to not report empty exports in a.d.ts file with only type import/exports.

Versions

packageversion
@typescript-eslint/eslint-plugin5.23.0
@typescript-eslint/parser5.23.0
@typescript-eslint/scope-manager5.23.0
@typescript-eslint/typescript-estree5.23.0
@typescript-eslint/type-utils5.23.0
@typescript-eslint/utils5.23.0
TypeScript4.6.4
ESLint8.15.0
node18.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp