-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Labels
Description
Expected behavior
Using the never return type on a method not using return statement should be allowed (it could even check that you don't return).
The never type is not equivalent to the void type (which is what the absence of a @returns represents). So being able to use the never type is useful when using type-checking (through tsc --allow-js --check-js) on the JS code
Actual behavior
The plugin rule complains about the presence of the @returns tag
ESLint Config
{
"root": true,
"plugins": ["jsdoc"],
"rules": {
"jsdoc/require-returns-check": "error"
}
}ESLint sample
class MyMetric {
/**
* @returns {never}
*/
computeByUsers() {
throw new Error('Computation grouped by user is not supported for this metric');
}
}Environment
- Node version: 14.18.2
- ESLint version: 7.32.0
eslint-plugin-jsdocversion: 37.1.0
markcellus