-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
check-types with option exemptTagContexts.tag still warns for no-undefined-types #695
check-types with option exemptTagContexts.tag still warns for no-undefined-types #695
Comments
Rules are almost always interdependent of one another in ESLint ( A rule's options could be changed into settings, however, which are allowed to be reused across rules, and I'd personally be ok with this if someone wanted to prepare a PR to change this option to a settings-based one. Note that you can get a variable not to be listed as undefined by adding it to |
Thanks for the answer @brettz9. You mentioned I am basically trying to use "jsdoc/no-undefined-types": ["error", {"definedTypes":["get", "post", "etc"]}] Although, a setting as you mention would definitely be the best answer to this as only the tag |
I had forgotten you could use As far as a solution to the redundancy, maybe {
settings: {
jsdoc: {
structuredTags: {
api: {type: ["get", "head", "post", "put", "patch", "delete"]}
}
}
}
} Given that you only want the types available to tags like |
…ay of permissible types, reporting if not present; fixes gajus#695
That is definitely a great solution! Would be nice to add custom tags to any custom param like that. |
I've offered a PR for that at #698. It doesn't allow |
I am using types like /**
* @api {get} /user/:id Request User information
* @apiName GetUser
* @apiGroup User
*
* @apiParam {Number} id Users unique ID.
*
* @apiSuccess {String} firstname Firstname of the User.
* @apiSuccess {String} lastname Lastname of the User.
*/ But that was probably not what you were asking? |
Those are most likely going to be treatable valid types though. If you put "get" in the box at https://jsdoctypeparser.github.io/ , you can see it works. The concern is more with special characters like Btw, I also added a commit to the PR to support treating |
Great, then I think I am fine. Using this will be sweet to solve my problem: {
settings: {
jsdoc: {
structuredTags: {
api: {type: ["get", "head", "post", "put", "patch", "delete"]}
}
}
}
} |
As soon as this is merged and released I will test it and reply back here :) |
…ay of permissible types, reporting if not present; fixes gajus#695
…ay of permissible types, reporting if not present; fixes #695
🎉 This issue has been resolved in version 32.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@brettz9 worked wonders 💯 |
(Note: I am unsure if this should belong to https://github.com/jsdoctypeparser/jsdoctypeparser/issues/ as it is a mix of things happening)
Expected behavior
I would not want to get a warning for
The type 'get' is undefined.eslintjsdoc/no-undefined-types
for the following parameter:@api {get} /users/ Get a list of users.
I expect to get no warning as I have setjsdoc/check-types
and the optionexemptTagContexts
to exemptapi
. To me this should mean that it should not care if it is defined or not, as I do not want to check the type.Actual behavior
I do get a warning.
ESLint Config
ESLint sample
Environment
eslint-plugin-jsdoc
version: 31.6.1The text was updated successfully, but these errors were encountered: