jsdoc/check-types
eslint-plugin-jsdoc
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/check-types": "error",
},
},
];Reports types deemed invalid (customizable and with defaults, for preventing and/or recommending replacements).
/**
* @param {abc} foo
*/
function quux (foo) {undefined
null
boolean
number
bigint
string
symbol
object (For TypeScript's sake, however, using `Object` when specifying child types on it like `Object<string, number>`)
Array
Function
Date
RegExpExamples from the ESLint documentation.
jsdoc/check-types
eslint-plugin-jsdoc
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/check-types": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Checks for dupe @param names, that nested param names have roots, and that parameter names in function declarations match JSDoc param names.
Controls how and whether JSDoc blocks can be expressed as single or multiple line blocks.
Requires a return statement in function body if a @returns tag is specified in JSDoc comment(and reports if multiple @returns tags are present).
Ensures that if a @yields is present that a yield (or yield with a value) is present in the function body (or that if a @next is present that there is a yield with a return value present).
Reports invalid alignment of JSDoc block asterisks.
Requires that all function parameters are documented with a @param tag.