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
And everything seem to be fine ( I activated "typescript.inlayHints.variableTypes.enabled": true for demostration ):
Code
(async()=>{// I used tsconfig.json -> 'compilerOptions' -> 'types' -> ['vite/types', '@total-typescript/reset']// everything from '@total-typescript/reset' looks working to me:constnetJson=await(awaitfetch('https://jsonplaceholder.typicode.com/todos/1')).json();conststrJson=JSON.parse("{hello: 'world'}");constarr=[1,2,undefined,'hello',true,false,[],{}];typeNumOrTrue=number|true;functionfilter(i: (typeofarr)[number]): i is NumOrTrue{returntypeofi==='number'||i===true;}constfiltered=arr.filter(filter);constincludes=[1,2,3,4].includes(3);constincludesConst=([1,2,3,4]asconst).includes(3);// and still use 'vite/types'constviteHot=import.meta.hot;})();
I did not see any issues using it like that, and it did not even override the Vite types.
If this works, it can also be used in libraries, I think.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi @mattpocock,
(I figured Youtube comments isn't the place to have a long disccustions about this.)
I accualy tried to add the
@total-typescript/ts-reset
library to the tsconfig like so(on existing vite- solidJS project):(https://www.typescriptlang.org/tsconfig#types)
And everything seem to be fine ( I activated
"typescript.inlayHints.variableTypes.enabled": true
for demostration ):Code
I did not see any issues using it like that, and it did not even override the Vite types.
If this works, it can also be used in libraries, I think.
Did I miss something?
Beta Was this translation helpful? Give feedback.
All reactions