Skip to content

refactor: rename scripts/*.mjs to *.mts for native TypeScript#584

Merged
John-David Dalton (jdalton) merged 3 commits intomainfrom
refactor/scripts-mts
Apr 15, 2026
Merged

refactor: rename scripts/*.mjs to *.mts for native TypeScript#584
John-David Dalton (jdalton) merged 3 commits intomainfrom
refactor/scripts-mts

Conversation

@jdalton
Copy link
Copy Markdown
Contributor

Node 25.9.0 supports .mts natively. Rename all scripts from .mjs to .mts for explicit ESM TypeScript.

The previous commit renamed scripts/*.mjs to *.mts but left behind
stale .mjs extensions in cross-file imports, spawn args, comments,
and workflow path triggers. Also renames .config/esbuild.config.mjs
to .mts to match the import in build.mts.
- Add type annotations to esbuild plugin params (PluginBuild, BuildResult, etc.)
- Use bracket notation for index signature access (process.env, parseArgs values)
- Add null/undefined guards for possibly-undefined values
- Fix catch clauses to use `catch (e)` with proper type narrowing
- Add `as const` for string literal types (format, platform, sourcemap)
- Add @types/semver for semver type declarations
- Fix openapi-typescript transform callback signatures
- Handle exactOptionalPropertyTypes correctly in return types
- Fix babel traverse/parser version mismatch with proper casts
@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​types/​semver@​7.7.11001007581100

View full report

@jdalton John-David Dalton (jdalton) merged commit 0e600f7 into main Apr 15, 2026
10 checks passed
@jdalton John-David Dalton (jdalton) deleted the refactor/scripts-mts branch April 15, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants