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
{{ message }}
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.
Allow specifying a prefix that will be added in front of every type automatically discovered. For example, if the given prefix is /*auto*/, and the input source file is as follows:
functionf(n){returnn+1;};f(5);
the result would be:
functionf(n: /*auto*/number){returnn+1;};f(5);
This can also be useful for toggling errors about the discovered types all at once. First, define a new type with a distinct name that maps to void. Then use this type name, followed by the pipe character (|) as a prefix. for instance, if you chose the name the type AutoDiscovered, then you declaration would look like:
typeAutoDiscovered=void;
and you will use the value AutoDiscovered| for your prefix. Then, you will be able to silence all TypeScript errors introduced by the discovered types by simply changing the declaration above to read:
typeAutoDiscovered=any;
Then you can toggle these errors on/off by simply switching the declaration of the type between any and void. Thanks @benland for this idea.
The text was updated successfully, but these errors were encountered:
Allow specifying a prefix that will be added in front of every type automatically discovered. For example, if the given prefix is
/*auto*/
, and the input source file is as follows:the result would be:
This can also be useful for toggling errors about the discovered types all at once. First, define a new type with a distinct name that maps to
void
. Then use this type name, followed by the pipe character (|) as a prefix. for instance, if you chose the name the typeAutoDiscovered
, then you declaration would look like:and you will use the value
AutoDiscovered|
for your prefix. Then, you will be able to silence all TypeScript errors introduced by the discovered types by simply changing the declaration above to read:Then you can toggle these errors on/off by simply switching the declaration of the type between
any
andvoid
. Thanks @benland for this idea.The text was updated successfully, but these errors were encountered: