Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
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
- clone the repo
yarn install
- Go to
index.d.ts
-> see that theexport {}
is flagged - Comment it out, and go to
another-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
package | version |
---|---|
@typescript-eslint/eslint-plugin | 5.23.0 |
@typescript-eslint/parser | 5.23.0 |
@typescript-eslint/scope-manager | 5.23.0 |
@typescript-eslint/typescript-estree | 5.23.0 |
@typescript-eslint/type-utils | 5.23.0 |
@typescript-eslint/utils | 5.23.0 |
TypeScript | 4.6.4 |
ESLint | 8.15.0 |
node | 18.1.0 |