-
-
Notifications
You must be signed in to change notification settings - Fork 168
Closed
Description
Expected behavior
A user should be able to document a function in Typescript that uses the "this" keyword
Actual behavior
Conflicting rules prevent this from passing warnings.
ESLint Config
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:jsdoc/recommended',
],
overrides: [],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'jsdoc'],
root: true,
rules: {
'jsdoc/require-param-type': 0,
'jsdoc/require-returns-type': 0,
'jsdoc/no-types': 2,
},
};
ESLint sample
type T = { name: string };
/**
* @param this desc
* @param bar number to return
* @returns number returned back to caller
*/
function foo(this: T, bar: number): number {
console.log(this.name);
return bar;
}
const bound = foo.bind({ name: 'baz' });
bound(2);
type T = { name: string };
/**
* @param bar number to return
* @returns number returned back to caller
*/
function foo(this: T, bar: number): number {
console.log(this.name);
return bar;
}
const bound = foo.bind({ name: 'baz' });
bound(2);
Environment
- Node version: 16
- ESLint version 8.25.0
eslint-plugin-jsdoc
version: 39.3.14