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
When attempting to apply the fix for 'jsdoc/require-jsdoc': ['warn', { require: { FunctionExpression: true } }],, the output is garbled, with the jsdoc /** * */ being inserted in the wrong location. I've provided a simple MRE to demonstrate the issue.
The empty jsdoc comment is inserted exactly prior to the function itself, e.g.,
e = /**
*
*/
function () {
}
when it should be placed prior to the naming token e.g.,
/**
*
*/
e = function () {
}
Additionally, in certain circumstances (functions as properties of an element) the fix is not idempotent, and will keep reapplying (see first example in MRE)
The text was updated successfully, but these errors were encountered:
gajus#403, gajus#502, gajus#522
Properly finds base node for affixing jsdoc block and uses to determine appropriate indent (finds base node in a manner sensitive to context, reusing existing and more accurate detection for this purpose, improving detection for function expressions, including arrow function expressions and method definitions).
As part of `getReducedASTNode` (used also within `getJSDocComment`), need to stop at `VariableDeclaration` or `ExpressionStatement` (where comments shouldl be checked). Needed for proper function expression documentation placement.
Also provides `getJSDocComment` as a named export
brettz9
added a commit
to dstaley/eslint-plugin-jsdoc
that referenced
this issue
May 3, 2020
When attempting to apply the fix for
'jsdoc/require-jsdoc': ['warn', { require: { FunctionExpression: true } }],
, the output is garbled, with the jsdoc/** * */
being inserted in the wrong location. I've provided a simple MRE to demonstrate the issue.The empty jsdoc comment is inserted exactly prior to the function itself, e.g.,
when it should be placed prior to the naming token e.g.,
Additionally, in certain circumstances (functions as properties of an element) the fix is not idempotent, and will keep reapplying (see first example in MRE)
The text was updated successfully, but these errors were encountered: