jsdoc/no-undefined-types
eslint-plugin-jsdoc
No autofixRecommended
eslint.config.js
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/no-undefined-types": "error",
},
},
];Besides some expected built-in types, prohibits any types not specified as globals or within @typedef.
/** @typedef {{id: number}} User *//**
* @param {string} foo - Bar.
*/
function quux(foo) {Examples from the ESLint documentation.
jsdoc/no-undefined-types
eslint-plugin-jsdoc
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/no-undefined-types": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Requires that @returns tag has type value (in curly brackets).
Requires that each @param tag has a type value (in curly brackets).
Checks for presence of JSDoc comments, on functions and potentially other contexts (optionally limited to exports).
Requires that returns are documented with @returns.
Requires all types/namepaths to be valid JSDoc, Closure compiler, or TypeScript types (configurable in settings).