-
-
Notifications
You must be signed in to change notification settings - Fork 162
How to prefer type Object<>
, but otherwise object
#709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
No, it's ok. We just felt that requiring "object" to include
But I'd generally be inclined to presume something like that, esp. being out for a while, is working as intended.
Yes, that is a good idea, though it seems it should perhaps be
Unfortunately, we can't do this so easily with jsdoctypeparser's current AST traverser. It does not pass along info on the children or their being children (only the parent), so we'd have to do our own traversal. |
It seems we already make an exception to allow |
@jaydenseric : Maybe you want to offer your opinion on #800 ? |
Closing in favor of carrying forward discussion on #800 . Hopefully to have a fix soon. |
TypeScript doesn't recognise
object<>
, but understandsObject<>
. By default,eslint-plugin-jsdoc
prefers theobject
type overObject
. My intent is to preferobject
when the type is not using<>
, but if it is, preferObject<>
.Object<>
?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
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<>
:Unfortunately, that results a never ending circle of autofix causing another error:
Environment
eslint-plugin-jsdoc
version: v32.3.0The text was updated successfully, but these errors were encountered: