You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * Run a function on some data * * @param {object} data Some data to process * @param {Function} [processor=data => data] A function to run * @returns {object} Processed data */functionprocessData(data,processor=data=>data){returnprocessor(data)}
Using 30.7.13 or lower, this is fine, but as of >=31.0.0 this now throws
1:1 error Missing JSDoc @param "processor" declaration jsdoc/require-param
5:0 error Expected @param names to be "data, processor". Got "data, " jsdoc/check-param-names
5:0 error Missing JSDoc @param "" description jsdoc/require-param-description
5:0 error There must be an identifier after @param tag jsdoc/require-param-name
Note this example (not using arrow syntax for the default):
/** * Run a function on some data * * @param {object} data Some data to process * @param {Function} [processor=function(data) { return data }] A function to run * @returns {object} Processed data */functionprocessData(data,processor=data=>data){returnprocessor(data)}
is fine with either version.
Is this a bug, or do I need to make a change to accommodate this version?
Expected behavior
Example above (using arrow function) should be valid (I think?)
Actual behavior
Provide a detailed description of how the software actually behaved
1:1 error Missing JSDoc @param "processor" declaration jsdoc/require-param
5:0 error Expected @param names to be "data, processor". Got "data, " jsdoc/check-param-names
5:0 error Missing JSDoc @param "" description jsdoc/require-param-description
5:0 error There must be an identifier after @param tag jsdoc/require-param-name
including any rationale for why that behavior is incorrect.
It was considered valid by <=30.7.13
ESLint Config
What is the minimal config that reproduces the issue?
I've included the full output of eslint --print-config at the end of the issue
ESLint sample
What code triggers the error?
/** * Run a function on some data * * @param {object} data Some data to process * @param {Function} [processor=data => data] A function to run * @returns {object} Processed data */functionprocessData(data,processor=data=>data){returnprocessor(data)}
V31 switched to a new version of comment-parser which helps preserve whitespace but which still has a few hiccups to work out (also #669), so good to have reported this. I filed syavorsky/comment-parser#112 , so I think we are now blocking on that.
Consider the following example:
Using 30.7.13 or lower, this is fine, but as of >=31.0.0 this now throws
Note this example (not using arrow syntax for the default):
is fine with either version.
Is this a bug, or do I need to make a change to accommodate this version?
Expected behavior
Example above (using arrow function) should be valid (I think?)
Actual behavior
It was considered valid by <=30.7.13
ESLint Config
Disabling these rules silences the error
I've included the full output of
eslint --print-config
at the end of the issueESLint sample
Environment
eslint-plugin-jsdoc
version: >=31.0.0Full output of
eslint --print-config
:The text was updated successfully, but these errors were encountered: