Код: Выделить всё
Argument of type 'number' is not assignable to parameter of type 'string'.
< /code>
Я добавил // @ts-check < /code> в файл html и импортный нижний колонтитул, но все же не удачи. />
// @ts-check
"use strict";
/**
* @param {string} [email] - Email address. (optional)
*/
function footer(email = "")
{
// main function
{
let html = "";
html += ``;
html += ``;
html += `[url=mailto:${email}]${email}[/url]`;
html += ``;
document.body.insertAdjacentHTML("beforeend", html);
}
}< /code>
// @ts-check
import
{
footer
} from "";
JSDoc Test
JSDoc Test
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Maecenas porttitor congue massa. Fusce posuere, magna sed
pulvinar ultricies, purus lectus malesuada libero, sit amet
commodo magna eros quis urna.
footer("name@someplace.com");
footer(1); // no error here but ts-check should complain because the param is not a string
Подробнее здесь: https://stackoverflow.com/questions/797 ... html-files