jsdoc/valid-types
eslint-plugin-jsdoc
No autofixRecommended
eslint.config.js
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/valid-types": "error",
},
},
];Requires all types/namepaths to be valid JSDoc, Closure compiler, or TypeScript types (configurable in settings).
/**
* @param {Array<string} foo
*/
function quux() {/**
* @param {Array<string>} foo
*/
function quux() {Examples from the ESLint documentation.
jsdoc/valid-types
eslint-plugin-jsdoc
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/valid-types": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforces lines (or no lines) before, after, or between tags.
Requires that returns are documented with @returns.
Checks for presence of JSDoc comments, on functions and potentially other contexts (optionally limited to exports).