Skip to content

fix: remove export type * in d.ts to support TS<5.0 #10070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

auvred
Copy link
Member

@auvred auvred commented Sep 28, 2024

PR Checklist

Overview

I decided to disable this rule for the entire repo, since I think we will forget to add eslint-ignore-next-line to every export * exporting only types. After a month or so (when typescript@4.9 support is discontinued), we can re-enable this rule.

Now we have export type * only in fixtures:

$ rg 'export type \*'

packages/eslint-plugin/tests/fixtures/consistent-type-exports/type-only-reexport.ts
3:export type * as typeOnlyExports from './type-only-exports';
5:export type * from './index';
7:export type * as indexExports from './index';

packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts
58:    "export type * from './consistent-type-exports/type-only-exports';",
59:    "export type * from './consistent-type-exports/type-only-reexport';",
62:    "export type * as foo from './consistent-type-exports/type-only-exports';",
63:    "export type * as foo from './consistent-type-exports/type-only-reexport';",
403:        export type * from './consistent-type-exports/type-only-exports';
443:        export type * from './consistent-type-exports/type-only-reexport';
460:        export type * as foo from './consistent-type-exports/type-only-reexport';

packages/eslint-plugin/src/rules/consistent-type-exports.ts
145:        // export type * from './module-with-type-and-value-exports'

packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-star-from/fixture.ts
3:export type * from 'bar';

packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/kind-type/fixture.ts
1:export type * as x from 'a';

packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/type-kind/fixture.ts
1:export type * from 'a';

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @auvred!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

Copy link

netlify bot commented Sep 28, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 7567d9a
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/66f7ccada50ffc0008585430
😎 Deploy Preview https://deploy-preview-10070--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 95 (🔴 down 4 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

nx-cloud bot commented Sep 28, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 7567d9a. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

Copy link

codecov bot commented Sep 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.02%. Comparing base (94c5484) to head (7567d9a).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10070      +/-   ##
==========================================
+ Coverage   86.01%   86.02%   +0.01%     
==========================================
  Files         427      427              
  Lines       14892    14903      +11     
  Branches     4329     4329              
==========================================
+ Hits        12810    12821      +11     
  Misses       1736     1736              
  Partials      346      346              
Flag Coverage Δ
unittest 86.02% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/scope-manager/src/definition/index.ts 100.00% <100.00%> (ø)
packages/scope-manager/src/scope/index.ts 100.00% <100.00%> (ø)
packages/typescript-estree/src/ts-estree/index.ts 83.33% <100.00%> (+8.33%) ⬆️
packages/utils/src/eslint-utils/index.ts 100.00% <100.00%> (ø)
packages/utils/src/ts-eslint/index.ts 100.00% <100.00%> (ø)

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 makes sense to me. Looking forward to dropping TS 4.* support in a future major!

@JoshuaKGoldberg JoshuaKGoldberg added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Sep 29, 2024
@JoshuaKGoldberg
Copy link
Member

Normally we'd wait 3+ days for a fix like this, but since we have our weekly release today and Kirk gave a 👍 ...

@JoshuaKGoldberg JoshuaKGoldberg merged commit 6ce66b5 into typescript-eslint:main Sep 30, 2024
65 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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