Skip to content

feat(eslint-plugin): [consistent-type-exports] check export * exports to see if all exported members are types #10006

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 3 commits into from
Sep 23, 2024

Conversation

auvred
Copy link
Member

@auvred auvred commented Sep 17, 2024

PR Checklist

Overview

@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 17, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 1a38fe4
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/66e94cc17b9b6a0008b2fdf1
😎 Deploy Preview https://deploy-preview-10006--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: 99 (🟢 up 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 17, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 5250bd8. 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

netlify bot commented Sep 17, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 5250bd8
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/66e9521591c4ed00086b91bd
😎 Deploy Preview https://deploy-preview-10006--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: 99 (🟢 up 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

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.69%. Comparing base (95a947a) to head (5250bd8).
Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
...eslint-plugin/src/rules/consistent-type-exports.ts 92.85% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10006   +/-   ##
=======================================
  Coverage   88.68%   88.69%           
=======================================
  Files         425      426    +1     
  Lines       14808    14838   +30     
  Branches     4307     4320   +13     
=======================================
+ Hits        13132    13160   +28     
- Misses       1533     1535    +2     
  Partials      143      143           
Flag Coverage Δ
unittest 88.69% <92.85%> (+<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% <ø> (ø)
packages/scope-manager/src/scope/index.ts 100.00% <ø> (ø)
packages/typescript-estree/src/ts-estree/index.ts 75.00% <ø> (-8.34%) ⬇️
packages/utils/src/eslint-utils/index.ts 100.00% <ø> (ø)
packages/utils/src/ts-eslint/index.ts 100.00% <ø> (ø)
...eslint-plugin/src/rules/consistent-type-exports.ts 96.26% <92.85%> (-1.44%) ⬇️

... and 3 files with indirect coverage changes

// Therefore, to filter out value properties, we use the following hack:
// checker.getPropertiesOfType returns all exports that were originally
// values, but checker.getPropertyOfType returns undefined for
// properties that are mentioned in the typeOnlyExportStarMap.
Copy link
Member

Choose a reason for hiding this comment

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

[Praise] Lovely. Nice investigation and very helpful comment! 🙂

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.

🔥 !

@JoshuaKGoldberg JoshuaKGoldberg merged commit d0e35d9 into typescript-eslint:main Sep 23, 2024
62 checks passed
@monodop
Copy link

monodop commented Sep 26, 2024

Is Typescript 4 still supported on this project? This change introduces a dependency on typescript 5.0, which breaks Typescript 4 scripts that are running eslint via the Node.JS API.

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#support-for-export-type-

@JoshuaKGoldberg
Copy link
Member

@monodop hmmmm. TS 4 should still be supported. Build tooling should be transpiling into .d.ts files supported by TS 4.8 per https://typescript-eslint.io/users/dependency-versions#typescript. If not, that's a bug we'd need to fix, so we'd request you please file an issue with a repro we can take a look at.

@monodop
Copy link

monodop commented Sep 27, 2024

@JoshuaKGoldberg I think the easiest way to see the issue is to just look at the dist output. e.g. https://www.npmjs.com/package/@typescript-eslint/scope-manager?activeTab=code

image

Copy link

Uh oh! @monodop, the image you shared is missing helpful alt text. Check #10006 (comment).

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.

@JoshuaKGoldberg
Copy link
Member

#10065

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: [consistent-type-exports] Check * exports to see if all exported values are types
3 participants