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