You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is the @suggest part of the value or part of the type?
Tying to the usage site, but it's intending to "replace" the type itself.
How does this get funneled along? What if you throw the type of a property through a mapped/conditional type? Do you then generate an @suggest whose contents were processed by said conditional or mapped type?
Lots of people ask for stuff like "GET" | "POST" | ... | string to achieve this. It doesn't make sense from a set theory perspective, but they want it for tooling.
People often want this to
Spell check literals that are "similar", but is at odds with supporting any string.
Completions.
We've heard Python is adding a type constructor for these purposes, but it is a little strange? Rejects unrecognized literals, allows all strings.
Tagging work we've done in the past (link @weswigham?) is one way to achieve this.
Need to better understand this. CSS Types, look on DT for unions with string.
Ideally, this completion data is associated with the type and traverses along.
Union origins achieve this almost - we preserve the non-normalized origin of a union if the type itself is a union.
Could have multiple string types with completion info associated, but then have to subtype-reduce them to a new string type with a "unioned" completion info.
Type system should tell you about sets of values and what are reasonable sets of values. This is entirely about editor experience and documentation.
Feels like we need to prove things out here.
The text was updated successfully, but these errors were encountered:
cts
files should be modules?#49207
import
/export
syntax present.moduleDetection
flag allows you to control that.force
option that makes it so that everything except.d.ts
files are modules.auto
, which saysmts
andmjs
are supposed to be modulescts
andcjs
ts
andjs
files--moduleDetection auto
to recognizects
andcjs
--moduleDetection force
in Node16+?cts
andcjs
will always be processed as (CJS) modules by Node.js, so we should always recognize them as (CJS) modules--module node16
implies you're going to be running in Node16 too?/** @suggest */
JSDoc Tag#49220
Want to suggest well-known values to users for a more open-ended field (e.g.
GET
,POST
,DELETE
... but the field is open-ended so it's just astring
).Bikeshed time
Is the
@suggest
part of the value or part of the type?@suggest
whose contents were processed by said conditional or mapped type?Lots of people ask for stuff like
"GET" | "POST" | ... | string
to achieve this. It doesn't make sense from a set theory perspective, but they want it for tooling.string
.We've heard Python is adding a type constructor for these purposes, but it is a little strange? Rejects unrecognized literals, allows all
string
s.Tagging work we've done in the past (link @weswigham?) is one way to achieve this.
[[Something about leveraging]]
Need to better understand this. CSS Types, look on DT for unions with
string
.Ideally, this completion data is associated with the type and traverses along.
Could have multiple
string
types with completion info associated, but then have to subtype-reduce them to a newstring
type with a "unioned" completion info.Type system should tell you about sets of values and what are reasonable sets of values. This is entirely about editor experience and documentation.
Feels like we need to prove things out here.
The text was updated successfully, but these errors were encountered: