-
-
Notifications
You must be signed in to change notification settings - Fork 165
Comparison with deprecated JSdoc related ESLint rules
Brett Zamir edited this page Apr 7, 2019
·
38 revisions
ESLint has end-of-lifed their jsdoc support and are recommending eslint-plugin-jsdoc as a replacement: https://eslint.org/blog/2018/11/jsdoc-end-of-life
Deprecated JSDoc component |
eslint-plugin-jsdoc replacement or tracking issue |
---|---|
"Maintaining the Doctrine JSDoc comment parser" | jsdoctypeparser |
"The require-jsdoc rule" | #162 |
"The valid-jsdoc rule" | #107; see also table below |
"The SourceCode#getJSDocComment method" | #189 (not a replacement, but we must reimplement) |
INCOMPLETE
Number | Feature from valid-jsdoc rule | Replacement within eslint-plugin-jsdoc or issue |
---|---|---|
1 | "missing return tag: @return or @returns " |
|
2 | "missing ... return type" | |
3 | "missing ... return description" | |
4 | "missing parameter tag: @arg , @argument , or @param " |
|
5 | "missing parameter ... type" | |
6 | "missing parameter ... description" | |
7 | "inconsistent order of parameter names in a comment compared to the function or method" | |
8 | "syntax error" | |
9 | Requiring return statement upon use of @return(s) tag (note: behavior only referenced in documentation code comment) |
The "correct" code comments for valid-jsdoc
also mention some specific behavior pertaining to these features:
@returns
:
-
@constructor
tag allows missing@returns
tag (#1 above) - class constructor allows missing
@returns
tag (#1 above) -
@override
tag allows missing ...@returns
tags (#1 above) -
@abstract
tag allows@returns
tag withoutreturn
statement (#9 above)
@param
tag:
-
@override
tag allows missing@param
... tags (#4 above)
Finally, this large rule had a number of options we ought to reimplement:
INCOMPLETE
Option | Accepted types | Replacement or tracking issue |
---|---|---|
"prefer" | object (item to replace keyed to replacement) | |
"preferType" | object (item to replace keyed to replacement) | |
"requireReturn" | boolean | |
"requireReturnType" | boolean | |
"matchDescription" | string (regular expression) | |
"requireParamDescription" | boolean | |
"requireReturnDescription" | boolean | |
"requireParamType" | boolean |