javascript/tsc
Type-checks plain JavaScript through its JSDoc comments.
Part of the javascript configuration, at the recommended level. It runs at the push stage, once per scope. It runs tsc.
A wrong call in JavaScript crashes at run time, and written types let the checker catch it first.
What to do
Section titled “What to do”Add or fix the JSDoc type that the error names.
Example
Section titled “Example”Passing a number to a JSDoc string parameter reports a type error. Pass a string, or fix the JSDoc.
Turn it off
Section titled “Turn it off”Turn it off for some files, with a reason:
gspot ignore javascript/tsc --paths "<glob>" --reason "<why>"To silence one place, write a comment such as:
// @ts-expect-error: the library types omit this overload