-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Labels
Description
TypeScript doesn't recognise object<>, but understands Object<>. By default, eslint-plugin-jsdoc prefers the object type over Object. My intent is to prefer object when the type is not using <>, but if it is, prefer Object<>.
- Is TypeScript / VS Code intellisense behavior incorrect, and we should push them for a speedy fix?
- Should the defaults take this TypeScript / VS Code intellisense behavior into account, and prefer
Object<>? - How can that manually be configured, today?
Expected behavior
By default, the types enforced with jsdoc/check-types should be compatible with TypeScript / VS Code intellisense.
Actual behavior
The object<> type is not.
ESLint Config
{
plugins: ['jsdoc'],
rules: {
'jsdoc/check-types': 'error'
}
}ESLint sample
To see the problem with the default prefered types, this will be an error:
/** @typedef {Object<string, boolean>} foo */To try to allow Object<>:
{
plugins: ['jsdoc'],
settings: {
jsdoc: {
preferredTypes: {
'object<>': 'Object',
},
},
},
rules: {
'jsdoc/check-types': 'error'
}
}Unfortunately, that results a never ending circle of autofix causing another error:
Environment
- Node version: v15.12.0
- ESLint version v7.23.0
eslint-plugin-jsdocversion: v32.3.0
mantoni and pjeweb


