You might have some JavaScript that you would like to ensure is more type sound but you don’t want to go through a process of adding type annotations everywhere.
Deno supports using the TypeScript type checker to type check JavaScript. You can mark any individual file by adding the check JavaScript pragma to the file:
These can be turned on for all JavaScript files in a program by providing a configuration file with the check JS option enabled:
And setting the option on the command line.
You might have TypeScript code that you are experimenting with, where the syntax
is valid but not fully type safe. You can always bypass type checking for a
whole program by passing the --no-check
.
You can also skip whole files being type checked, including JavaScript if you have check JS enabled, by using the no-check pragma: