-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Description
Expected behavior
jsdoc/valid-types does not warn for {message: string?}.
Actual behavior
index.js:2:0: Syntax error in type: {message: string?} [Warning/jsdoc/valid-types]
ESLint Config
{
"extends": [
"plugin:jsdoc/recommended"
]
}ESLint sample
/**
* @param {{message: string?}} options Options.
*/
function MyError(options) {
}Environment
- Node version: v12.21.0
- ESLint version v7.27.0
eslint-plugin-jsdocversion: v35.1.1 or v35.1.0
Additional Info
The issue does not occur with eslint-plugin-jsdoc@35.0.0 or earlier. The postfix ? to indicate a nullable type is not mentioned in https://jsdoc.app/tags-type.html. It is mentioned in https://github.com/google/closure-compiler/wiki/Types-in-the-Closure-Type-System#user-content-the-javascript-type-language as a deprecated syntax. I'm not sure whether it should be accepted without settings.jsdoc.mode: closure (it does not appear to be accepted with settings.jsdoc.mode: closure either).
Thanks,
Kevin