feat: experimental isolated declaration support #411
+155
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add experimental support for isolated declaration generation powered by OXC and unplugin-isolated-decl by @sxzz ❤️
Read more: microsoft/TypeScript#58944
To opt in:
Tips for migrating the codebase to be ready for isolated declaration support:
ts-fix
might help. (you can try withnpx @pi0/[email protected] -w
- see Publish on NPM for easier installation microsoft/ts-fix#29)@typescript-eslint/explicit-function-return-type
is helpful to find all issues (refactor: add explicit return types #412)transformer: "typescript"
might help to find issues easier. Defaultoxc
sometimes is crypted about which line.TODO
Currently plugin generates types to
dist/src/**.{mts,cts}
. We need to find a way to merge them or at least generate top level declaration indist/*.{mts,dts}
to make it cleaner forpackage.json
exports and avoid requirement of updating it. Also the paths seem relative to root intsconfig
rather thandist
!