We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
nodenext
#47444
node_modules/@types
types
/// <reference types="some-package" />
node16
import
require
/// <reference types"..." />
type
package.json
tsconfig
.mts
.cts
exports
Meaning we could say "it's always import, we'll make sure DefinitelyTyped guarantees identical types"
really talking about node_modules/@types
Not quite true - this is only true for unspecified types array. A specified entry in types will do a resolution into node_modules.
node_modules
/// <reference types="foo" />
foo.ts
node_modules/@types/foo.ts
#50290
@types/babel__traverse
The text was updated successfully, but these errors were encountered:
"I hate modules" "I hate types"
🤣
Sorry, something went wrong.
No branches or pull requests
Type Reference Directives in
nodenext
#47444
node_modules/@types
and brings them into the program unless you use thetypes
field./// <reference types="some-package" />
node16
resolution can support bothimport
andrequire
.import
would do in that file./// <reference types"..." />
does will go toimport
in ESM,require
in CJStypes
a tsconfig?type
field inpackage.json
.tsconfig
for severalpackage.json
s?.mts
and.cts
- bundlers just go to theexports
.import
?types
intsconfig
, we're really talking aboutnode_modules/@types
, which almost always corresponds to DefinitelyTyped.Meaning we could say "it's always
import
, we'll make sure DefinitelyTyped guarantees identical types"Not quite true - this is only true for unspecified types array. A specified entry in
types
will do a resolution intonode_modules
./// <reference types="foo" />
, we'll go intonode_modules
and grabfoo.ts
node_modules/@types/foo.ts
Substitution Type Optimizations
#50290
@types/babel__traverse
.The text was updated successfully, but these errors were encountered: