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.
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
feat: support TypeScript config using
importx
#18440base: main
Are you sure you want to change the base?
feat: support TypeScript config using
importx
#18440Changes from all commits
84f49f8
16f7cb9
95ece9b
45e5cf6
ed95f5f
aa6cdcc
5fe8d19
e8ea5cd
3a9a1b3
035d0e4
771c46a
bd811ba
bac5ddf
5ebc126
d2660d6
744a152
9d02520
34e81d6
df00166
d7a3132
17a3a4e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because Node.js is the only runtime that can't load TypeScript natively, maybe we can also check that
globalThis.Deno
andglobalThis.Bun
are undefined before loadingimportx
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With register/module-loader like
ts-node
ortsx
(the cli), or testing frameworks like Vitest, Node.js can load TypeScript - the goal forimportx
is to cover those details, where ESLint or other users can be agnostic to runtime like Deno and Bun, while also could automatically work if we have yet another runtime in the future.importx
already doing lazying loading internally - so importingimportx
itself should be fairly lightweight.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure I'm understanding, you're saying
importx
will already check for Deno and Bun and not do anything additional in that case?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to install
importx
on Deno (marked as a dev dependency inpackage.json
if that matters) and it still downloaded a bunch of packages, includingjiti
,tsx
andtypescript
. It seems unnecessary to require users to install all those packages if their runtime handles TS files out of the box.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah that's a good point. In that case, I think a line to check the
Deno
andBun
in ESLint won't hurt, yes - Will do.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't correctly restored, causing
process.version
to always be the mocked value for sub-sequence tests.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my gosh, thank you so much for figuring this one out, I was banging my head on the wall for quite some time trying to figure this one out.