-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Labels
Description
Expected behavior
With the following snippet the TypeScript language service correctly displays the JSDoc when inspecting the function, and I expect jsdoc/require-jsdoc to know the function is documented.
/**
* @param a Some description
* @param b Some other description
* @returns The sum of a and b
*/
function add(a:string, b:string):string;
function add(a:number, b:number): number;
function add(a: any, b:any): any {
return a + b;
}Actual behavior
The require-doc rule reports that the function is missing a JSDoc comment and expects the JSDoc to be positioned under the overloads, but this way the TypeScript language service does not display the given docs upon inspection.
function add(a:string, b:string):string;
function add(a:number, b:number): number;
/**
* @param a Some description
* @param b Some other description
* @returns The sum of a and b
*/
function add(a: any, b:any): any {
return a + b;
}See TypeScript language service behaviour in this example.
ESLint Config
//eslint.config.js
import jsdoc from "eslint-plugin-jsdoc";
export default [jsdoc.configs["flat/recommended-typescript"]];Environment
- Node version: 20.x
- ESLint version 8.56.0
eslint-plugin-jsdocversion: 48.0.2
JacobLey and adamhl8