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
jsdoc/check-param-names incorrectly failing when using default params #377
Comments
/**
* Loads server with { async start(), async stop() } signature
*
* @name core.loadServer
* @param {string} [name='server'] The name of the unraid server to load.
*/ ^would work |
I have another rule that clashes as it requires spaces like this |
Sounds like a good first contribution. |
@gajus would this be the "correct" way of fixing this? If so I'll open a PR. diff --git a/src/rules/checkParamNames.js b/src/rules/checkParamNames.js
index 72cf61f..6675e35 100644
--- a/src/rules/checkParamNames.js
+++ b/src/rules/checkParamNames.js
@@ -40,7 +40,7 @@ const validateParameterNames = (targetTagName : string, functionParameterNames :
return false;
}
- if (functionParameterName !== tag.name) {
+ if (functionParameterName !== tag.name.trim()) {
const expectedNames = functionParameterNames.join(', ');
const actualNames = paramTags.map(([, {name}]) => {
return name; Before:
After: |
Looks great to me. If you could just add the passing test, along with this config (assuming you are using parserOptions: {
ecmaVersion: 2017,
}, (While we could look at getting |
🎉 This issue has been resolved in version 18.4.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The error I'm getting.
The text was updated successfully, but these errors were encountered: