-
-
Notifications
You must be signed in to change notification settings - Fork 163
Disallow {[string]} array notation #495
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
Both jsdoc and Closure have open issues to add this support. (There are also issues filed with closure and jsdoc which may also be of interest in seeking to add a way for jsdoc to add names for the components (Tuple in the case of the closure feature request); but these are not supported in jsdoctypeparser.) There is a jsdoctypeparser issue filed, but the PR I put together for it needs research toward which rule differences exist for which modes, and I haven't found time for this research. However, I should be able to complete the PR earlier and just add to the different modes gradually, such as treating tuples as disallowed for So that aspect is really a jsdoctypeparser, but as with your other issue recently filed, the fixer does have something for us to fix on our end. |
Thanks for the super explicit and referenced clarification! (I like your style 👍 ) Yeah, I would like to disable the tuple type in projects that doesn't use TypeScript |
Closing as this is effectively a dupe of part of #356, though I have made explicit mention there of this use case. |
Hum FYI I just remembered where I saw the /**
* Foo function.
*
* @param {[number, string]} bar - The bar array.
*/
function foo(bar) {} |
This comment has been minimized.
This comment has been minimized.
🎉 This issue has been resolved in version 28.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I know that the
{[string]}
array notation doesn't exists at all.. but I can find it quite often in my company code base, and I would like to restrict it (ideally with an auto fix). Does that make sense?Is it possible to disallow and fix this kind of array notation?
❌ This should be disallowed
And fixed depending on
preferredTypes
to eitherThe text was updated successfully, but these errors were encountered: