-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Description
Expected behavior
Sometimes I want to write @example tags with code syntax inside. A contrived example:
/**
* @example
* ```
* type Example = ElementType<string[]>; // string
* ```
*/
type ElementType<T> = T extends (infer Element)[] ? Element : never;I should be allowed to use characters like < and >.
Actual behavior
jsdoc/text-escaping reports:
You have unescaped HTML characters < or & in a tag
...and autofixes the offending line to:
* type Example = ElementType<string[]>; // stringESLint Config
import jsdoc from 'eslint-plugin-jsdoc';
const config = [
// configuration included in plugin
jsdoc.configs['flat/recommended'],
// other configuration objects...
{
files: ['**/*.js'],
plugins: {
jsdoc,
},
rules: {
'jsdoc/text-escaping': 'warn'
}
}
];
export default config;ESLint sample
See earlier.
// Format JS code hereEnvironment
- Node version:
- ESLint version
eslint-plugin-jsdocversion: