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

chore: move CJS scripts to ESM and use strippable types#10887

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

43081j
Copy link
Contributor

@43081j43081j commentedFeb 25, 2025
edited by kirkwaiblinger
Loading

Depends on#10886

This prepares the various scripts for being consumed bynode directly (via the strip-types feature).

Primarily this means the following:

  • Our packages aretype: "commonjs", so some of our scripts are incorrectly*.ts (CJS) whichtsx covers up by the fact it transpiles it to CJS on the fly
    • Moving any*.ts scripts to*.mts solves this
  • enum are not allowed since they are not strippable types. instead, we just use a string union

DRAFT UNTIL#10885 is accepting PRs and#10886 is merged

PR Checklist

Also related to#10885

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@43081j!

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 onhttps://opencollective.com/typescript-eslint.

@43081j43081j changed the titleNodets types prepcleanup: move ESM scripts to .mts and use strippable typesFeb 25, 2025
@netlifyNetlify
Copy link

netlifybot commentedFeb 25, 2025
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit08096b0
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/67c48baee728e10008e1d74d
😎 Deploy Previewhttps://deploy-preview-10887--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: 93 (🔴 down 5 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (🟢 up 8 from production)
SEO: 98 (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 yourNetlify site configuration.

@43081j43081j changed the titlecleanup: move ESM scripts to .mts and use strippable typeschore: move ESM scripts to .mts and use strippable typesFeb 25, 2025
@nx-cloudNx Cloud
Copy link

nx-cloudbot commentedFeb 25, 2025
edited
Loading

View yourCI Pipeline Execution ↗ for commit08096b0.

CommandStatusDurationResult
nx run-many --target=build --exclude website --...✅ Succeeded5sView ↗
nx run-many --target=clean✅ Succeeded10sView ↗

☁️Nx Cloud last updated this comment at2025-03-02 19:45:50 UTC

@kirkwaiblingerkirkwaiblinger changed the titlechore: move ESM scripts to .mts and use strippable typeschore: move CJS scripts to ESM and use strippable typesFeb 27, 2025
@kirkwaiblinger
Copy link
Member

@43081j I edited a few things with which issues are linked. Feel free to undraft once ready for review!

@kirkwaiblingerkirkwaiblinger added the repo maintenancethings to do with maintenance of the repo, and not with code/docs labelFeb 27, 2025
This switches various repo scripts to be `*.mts` files (since that iswhat they actually are, given we don't build them into CJS output, yetour package `type` is `"commonjs"`).This will allow newer Node to execute them correctly, as they will nowinfer the correct module type.The `generate-lib` script has also been changed to use only strippabletypes (i.e. no enums).Both of these changes mean we have the option to drop `tsx` in futureand use `--experimental-strip-types` (when it is no longerexperimental).
@codecovCodecov
Copy link

codecovbot commentedMar 1, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.43%. Comparing base(3c7b8ff) to head(08096b0).
Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@##             main   #10887   +/-   ##=======================================  Coverage   87.43%   87.43%           =======================================  Files         468      468             Lines       16040    16040             Branches     4649     4649           =======================================  Hits        14025    14025             Misses       1658     1658             Partials      357      357
FlagCoverage Δ
unittest87.43% <ø> (ø)

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

@43081j43081j marked this pull request as ready for reviewMarch 1, 2025 19:36
@43081j
Copy link
ContributorAuthor

this should be good to go now@kirkwaiblinger

kirkwaiblinger reacted with thumbs up emoji

Copy link
Member

@kirkwaiblingerkirkwaiblinger left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks! One question but no action requested

@JoshuaKGoldbergJoshuaKGoldberg mentioned this pull requestMar 2, 2025
3 tasks
@JoshuaKGoldbergJoshuaKGoldberg added the awaiting responseIssues waiting for a reply from the OP or another party labelMar 2, 2025
@43081j
Copy link
ContributorAuthor

43081j commentedMar 2, 2025
edited
Loading

Not too sure why ci is failing. Doesn't seem related to the changes here, but that is more concerning 😅 if main has problems

Maybe catching up from main will help. Next time I'm at a laptop I'll do that unless someone beats me to it

Copy link
Member

@kirkwaiblingerkirkwaiblinger left a comment

Choose a reason for hiding this comment

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

Thanks for making these changes! It's always satisfying to me to get TS a step closer to out-of-the-box node.js rather than requiring layers of transpilation and/or CLI tools just to be able to execute 🙂

Re the integration test that was failing, that was fixed in#10906 👍

@kirkwaiblingerkirkwaiblinger added 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge and removed awaiting responseIssues waiting for a reply from the OP or another party labelsMar 2, 2025
@JoshuaKGoldbergJoshuaKGoldberg merged commit2810ceb intotypescript-eslint:mainMar 3, 2025
94 of 95 checks passed
@43081j43081j deleted the nodets-types-prep branchMarch 3, 2025 23:11
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsMar 11, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg left review comments

@kirkwaiblingerkirkwaiblingerkirkwaiblinger approved these changes

Assignees
No one assigned
Labels
1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we mergerepo maintenancethings to do with maintenance of the repo, and not with code/docs
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Bug:tsx executes scripts in ESM context in Node 23.6
3 participants
@43081j@kirkwaiblinger@JoshuaKGoldberg

[8]ページ先頭

©2009-2025 Movatter.jp