Experimentation repo for various ways to type react apps.
See ./src folder for examples
To enable TS to run everywhere use the js/ts.implicitProjectConfig.checkJS setting in your VScode workspace or user settings.
"js/ts.implicitProjectConfig.checkJs": true
The //@ts-ignore tells TypeScript to ignore the TypeScript errors in the line following the comment.
function mapValues(object, mapFunction) {
// @ts-ignore
return Object.fromEntries(Object.entries(object).map(([key, value]) => [key, mapFunction(value)]))
}
This //@ts-expect-error will ignore any typechecking failures in the next line, but will fail the typecheck if there are no errors
function mapValues(object, mapFunction) {
//@ts-expect-error
return Object.fromEntries(Object.entries(object).map(([key, value]) => [key, mapFunction(value)]))
}
// @ts-ignore-start
// @ts-ignore-end
Nuclear option to disable in file
// @ts-nocheck
querySelector and querySelectorAll@microsoft/api-extractor + @microsoft/api-documenter3,574 followers · starred Aug 2023
2,317 followers · starred Apr 2022
276 followers · starred Jul 2023
2,582 followers · starred Aug 2023
Experimentation repo for various ways to type react apps.
See ./src folder for examples
To enable TS to run everywhere use the js/ts.implicitProjectConfig.checkJS setting in your VScode workspace or user settings.
"js/ts.implicitProjectConfig.checkJs": true
The //@ts-ignore tells TypeScript to ignore the TypeScript errors in the line following the comment.
function mapValues(object, mapFunction) {
// @ts-ignore
return Object.fromEntries(Object.entries(object).map(([key, value]) => [key, mapFunction(value)]))
}
This //@ts-expect-error will ignore any typechecking failures in the next line, but will fail the typecheck if there are no errors
function mapValues(object, mapFunction) {
//@ts-expect-error
return Object.fromEntries(Object.entries(object).map(([key, value]) => [key, mapFunction(value)]))
}
// @ts-ignore-start
// @ts-ignore-end
Nuclear option to disable in file
// @ts-nocheck
querySelector and querySelectorAll@microsoft/api-extractor + @microsoft/api-documenter3,574 followers · starred Aug 2023
2,317 followers · starred Apr 2022
276 followers · starred Jul 2023
2,582 followers · starred Aug 2023