jsdoc/check-examples
eslint-plugin-jsdoc
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/check-examples": "error",
},
},
];@deprecated - Use getJsdocProcessorPlugin processor; ensures that (JavaScript) samples within @example tags adhere to ESLint rules.
/**
* @example alert('hello')
*/
function quux () {/**
* @example ```js
alert('hello');
```
*/
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/check-examples
eslint-plugin-jsdoc
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/check-examples": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Converts non-JSDoc comments preceding or following nodes into JSDoc ones
Enforces minimum number of newlines before JSDoc comment blocks
Reports the name portion of a JSDoc tag if matching or not matching a given regular expression.
Reports when certain comment structures are always expected.