Skip to content
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

fix: export type information for node16 module resolution #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RebeccaStevens
Copy link

See TS 4.7-rc Release Notes for details.

@RebeccaStevens RebeccaStevens force-pushed the node16-types-exports branch 3 times, most recently from 6db0155 to c00f8d4 Compare May 20, 2022 13:12
@zvictor
Copy link

zvictor commented Jun 15, 2022

I was about to create a PR for this, but @RebeccaStevens has done a great job here already.
Please @jonschlinkert merge it whenever possible 🙂

@chentsulin
Copy link

chentsulin commented Aug 19, 2022

@jonschlinkert @TrySound Is there any chance to move this forward? This blocks people using TS ESM with is-plain-object.

@e1himself
Copy link

@jonschlinkert is this library unmaintained?

@andykenward
Copy link

Just ran into this issue when migrating a codebase to "moduleResolution": "node16".
I use @tsconfig/node18 for my tsconfig.json and they have recently published moduleResolution changes to remove the legacy node/node10 usage. So I can imagine more of the same issues appearing in other NPM packages.

Anyone know of an alternative NPM package that you can use to resolve this issue? Otherwise I'll just fork this one, fix the issue and publish to NPM.

@chentsulin
Copy link

https://github.com/sindresorhus/is-plain-obj works well with TypeScript ESM.

ybiquitous added a commit to stylelint/stylelint that referenced this pull request Nov 7, 2023
Summary:
- Rewrite TypeScript definitions to use ESM syntax, avoiding the specific syntax like `namespace`.
- Update `tsconfig.json` for ESM and Node.js 18.
- Remove no longer needed `test.d.ts`.
- Add a patch for the `is-plain-object` package to avoid type-check errors.

See also:
- https://www.typescriptlang.org/tsconfig
- https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#package-json-exports-imports-and-self-referencing
- jonschlinkert/is-plain-object#28
ybiquitous added a commit to stylelint/stylelint that referenced this pull request Nov 9, 2023
Summary:
- Rewrite TypeScript definitions to use ESM syntax, avoiding the specific syntax like `namespace`.
- Update `tsconfig.json` for ESM and Node.js 18.
- Remove no longer needed `test.d.ts`.
- Add a patch for the `is-plain-object` package to avoid type-check errors.

See also:
- https://www.typescriptlang.org/tsconfig
- https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#package-json-exports-imports-and-self-referencing
- jonschlinkert/is-plain-object#28
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.

5 participants