Skip to content

Bug: 'export type *' in output .d.ts files break TS<5 #10065

Closed
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

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 have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Issue Description

Filing an issue for @monodop's #10006 (comment): #10006 added export type* to our output .d.ts. But per https://typescript-eslint.io/users/dependency-versions#typescript we still support TS 4.8.4.

In TS 4.8.4, we now have these type errors if you don't use skipLibCheck:

node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts:3:1 - error TS1383: Only named exports may use 'export type'.

3 export type * from './Definition';
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts:13:1 - error TS1383: Only named exports may use 'export type'.

13 export type * from './Scope';
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@typescript-eslint/types/dist/index.d.ts:2:1 - error TS1383: Only named exports may use 'export type'.

2 export type * from './lib';
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@typescript-eslint/types/dist/index.d.ts:3:1 - error TS1383: Only named exports may use 'export type'.

3 export type * from './parser-options';
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is a bug on our end.

In the meantime, a workaround can be to either not update to 8.7.0 of our tooling, or use skipLibCheck in your TSConfig.

Reproduction Repository Link

https://github.com/JoshuaKGoldberg/repros/tree/tseslint-export-type-ts-4

Repro Steps

  1. clone the repo and branch
  2. npm install
  3. npm run tsc

Versions

a

package version
@typescript-eslint/scope-manager 8.7.0
@typescript-eslint/type-utils 8.7.0
TypeScript 4.8.4

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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions