jsdoc/ts-prefer-function-type
eslint-plugin-jsdoc
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/ts-prefer-function-type": "error",
},
},
];Prefers function types over call signatures when there are no other properties.
/**
* @param {{
* (arg: string): void;
* }} someName
*//**
* @param {() => number} someName
*/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/ts-prefer-function-type
eslint-plugin-jsdoc
import jsdoc from "eslint-plugin-jsdoc";
export default [
{
plugins: { jsdoc },
rules: {
"jsdoc/ts-prefer-function-type": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Catches unnecessary template expressions such as string expressions within a template literal.
Disallows (or requires descriptions for) @ts-<directive> comments, mirroring @typescript-eslint/ban-ts-comment.
Auto-escape certain characters that are input within block and tag descriptions.
Sorts tags by a specified sequence according to tag name, optionally adding line breaks between tag groups.
Requires that throw statements are documented with @throws tags.