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

Docs: "types" and "typings" are synonymous in Module Resolution.md #2863

Closed
HamdaanAliQuatil opened this issue Jun 18, 2023 · 1 comment
Closed

Comments

@HamdaanAliQuatil
Copy link

Page URL: https://www.typescriptlang.org/docs/handbook/module-resolution.html#how-typescript-resolves-modules

Issue: package.json can contain any of the two fields types and typings. When TypeScript resolves a module it may look for either of the two fields. It would be beneficial from a clarity and documentation standpoint if the Module Resolution.md mentioned that the typings field can be used interchangeably with the types field.

Recommended fix: Rewrite for clarity in Module Resolution.md under the following section:

  1. Add a note under "How TypeScript resolves modules" mentioning typings is also permissible in package.json
  2. Under relative import pt. 4, mention typings within parenthesis.
  3. Under non-relative import pt. 4, 12, and 20, mention typings within parenthesis.
  4. Leave output under "Tracing module resolution" in the current state as it is not incorrect.
  5. Add a note under "Things to look out for" pt 3, indicating that the output may contain a typings field.
@jakebailey
Copy link
Member

Per #2804, we're not accepting non-critical issues. That being said, I think we already turned down this change as typings is not something we want anyone using even if it technically works.

@jakebailey jakebailey closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2023
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 a pull request may close this issue.

2 participants