jsdoc/require-throws
eslint-plugin-jsdoc
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/require-throws": "error",
},
},
];/**
*
*/
function quux (foo) {
throw new Error('err')
}/**
* @throws An error.
*/
function quux () {
throw new Error('err')
}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-throws
eslint-plugin-jsdoc
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/require-throws": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Requires @template tags be present when type parameters are used.
Sorts tags by a specified sequence according to tag name, optionally adding line breaks between tag groups.
Auto-escape certain characters that are input within block and tag descriptions.
Requires that Promise rejections are documented with @rejects tags.
Disallows (or requires descriptions for) @ts-<directive> comments, mirroring @typescript-eslint/ban-ts-comment.