jsdoc/require-rejects
eslint-plugin-jsdoc
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/require-rejects": "error",
},
},
];/**
*
*/
async function quux () {
throw new Error('abc');
}/**
* @rejects {Error}
*/
async function quux () {
throw new Error('abc');
}Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
jsdoc/require-rejects
eslint-plugin-jsdoc
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/require-rejects": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Requires a hyphen before the @param description (and optionally before @property descriptions).
Requires @template tags be present when type parameters are used.
Checks that all files have one @file, @fileoverview, or @overview tag at the beginning of the file.
Requires that throw statements are documented with @throws tags.