Skip to content

Conversation

@RobinTail
Copy link
Owner

@RobinTail RobinTail commented Jan 7, 2025

This will come handy for JSR and Node 24 bare typescript running (early available without flags in 23.6):
https://nodejs.org/api/typescript.html#type-stripping

For typescript running will also need verbatimModuleSyntax

UPD: erasableSyntaxOnly from TS 5.8 can be used to ensure base typescript running

@RobinTail RobinTail added the refactoring The better way to achieve the same result label Jan 7, 2025
@coveralls-official
Copy link

coveralls-official bot commented Jan 12, 2025

Coverage Status

coverage: 100.0%. remained the same
when pulling c3b3db7 on import-extenstions
into 74a1de9 on master.

@RobinTail RobinTail force-pushed the import-extenstions branch from 47b3511 to c2964f2 Compare March 26, 2025 11:46
@RobinTail RobinTail closed this Jun 26, 2025
RobinTail added a commit that referenced this pull request Oct 4, 2025
`module: node20` introduced in Typescript 5.9 as a stable replacement
for `nodenext`:

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-9.html#support-for---module-node20

The recommended combination is with `moduleResolution: node16`:
microsoft/TypeScript#61805

That change implies relative imports to have extensions, however, it's
possible to change them directly to `.ts`, which will also reiterate and
resolve #2289 . It will enable running typescript natively by Node.js
without `tsx`. It may also come handy if I decide to publish to JSR.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- Chores
- Project build and compiler settings standardized; JSON imports made
explicit and some tooling switched to static JSON imports.
- Refactor
- Internal module references normalized to explicit TypeScript entries;
some runtime identifiers now derive from environment-provided build
metadata.
- Tests
- Test imports updated for explicit module resolution; migration tests
expanded with additional valid cases.
- Style
- New lint rules encourage .ts extensions for local imports and
discourage direct package.json imports.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring The better way to achieve the same result

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants