jsdoc/sort-tags
eslint-plugin-jsdoc
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/sort-tags": "error",
},
},
];Sorts tags by a specified sequence according to tag name, optionally adding line breaks between tag groups.
/**\r
* @param a A\r
* @example quux(a);\r
*/\r
function quux (a) {}/**
* @param b
* @param a
* @returns {string}
*/
function quux () {}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/sort-tags
eslint-plugin-jsdoc
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/sort-tags": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Requires that throw statements are documented with @throws tags.
Auto-escape certain characters that are input within block and tag descriptions.
Requires @template tags be present when type parameters are used.
Disallows (or requires descriptions for) @ts-<directive> comments, mirroring @typescript-eslint/ban-ts-comment.
Catches unnecessary template expressions such as string expressions within a template literal.