Skip to content

Instantly share code, notes, and snippets.

@przemyslawjanpietrzak
Last active December 11, 2018 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save przemyslawjanpietrzak/7608e933496d9cbf9616b3090be6b8d5 to your computer and use it in GitHub Desktop.
Save przemyslawjanpietrzak/7608e933496d9cbf9616b3090be6b8d5 to your computer and use it in GitHub Desktop.
// @ts-check
export const fn = (arg1, arg2, arg3) => 42;
fn(1, 2, 3, 4); // ERROR Expected 3 arguments, but got 4
document.querySelector(42); // ERROR Argument of type '42' is not assignable to parameter of type 'string'.
/**
*
* @param {string} arg
* @returns {number}
*/
function fn1(arg) {
return arg / 2; // ERROR
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment