-
-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Update tsconfig.json
to use use node16 module resolution
#123
Conversation
Where is JSON still required? 🤔 |
Codecov ReportBase: 100.00% // Head: 100.00% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #123 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 460 460
=========================================
Hits 460 460 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
rehype/packages/rehype-cli/cli.js Lines 8 to 9 in b9e9b99
|
604da92
to
c898b77
Compare
Ohh yeah... That's been a while. I'll probably hardcode it soon. Weird that ts doesn't understand you can do that with cjs |
Well this file technically isn't CJS, it's ESM, with a custom CJS resolve defined inside it 😅 rehype/packages/rehype-cli/cli.js Line 6 in c898b77
|
It kind of understands. With import foo = require('bar') gets compiled to: import { createModule } from 'node:module'
const require = createModule(import.meta.url)
const foo = require('bar') But indeed, it doesn’t understand if this is written manually, whether in JS or TS.. |
Still, I think |
I agree it likely shouldn't be required.
|
tsconfig.json
to use use node16 module resolution
This comment has been minimized.
This comment has been minimized.
It knows that it is a require call right, as it resolves things from it. Presumably it can differentiate between imports and requires. So I don’t understand why it treats it as if it would use “ESM”/import semantics instead of “CJS”/require ones |
Thanks! |
I really thought it was required, but shouldn’t be! Anyway, I have no further comments if it is. |
Initial checklist
Description of changes
Additionally scopes JSON module to the one (CJS) location where it is used.