Check or compile Typescript.
For example, if you are using the approach described in Using Typescript without compilation, by Pascal Schilp, dev.to, Mar 26, 2023 and Type Safe JavaScript with JSDoc, by TruckJS, Medium, Sep. 4, 2018, you might have annotated your JavaScript with JSDoc. If you want to check it on the command line, you might run:
docker run --rm \
-v "$(pwd)"/example01:/code \
dcycle/typescript:1 --noEmit --checkJs .
If you want to test all files in a project, with the target of es6 (version es6 of the JavaScript language) you can run:
find ./app/code -name "*.js" -print0 | \
xargs -0 docker run --rm -v "$(pwd)":/code \
dcycle/typescript:1 \
--noEmit --checkJs --target es6
See this project on the Docker Hub.
To ignore a false positive use:
// @ts-expect-error