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
/** * @typedef {Object} mw.widgets.NamespaceInputWidget~DropdownOptions * @property {any} data * @property {string} label *//** * Get a list of namespace options, sorted by ID. * * @method getNamespaceDropdownOptions * @param {Object} [config] Configuration options * @return {DropdownOptions[]} Dropdown options * @memberof mw.widgets.NamespaceInputWidget */mw.widgets.NamespaceInputWidget.static.getNamespaceDropdownOptions=function(config){
The line @return {DropdownOptions[]} Dropdown options warns with The type 'DropdownOptions' is undefined.eslintjsdoc/no-undefined-types
The eslint warning can be fixed by changing this to @return {mw.widgets.NamespaceInputWidget~DropdownOptions[]} Dropdown options, but this has downsides:
breaks VS Code tooltips
makes generated docs (npm run doc) more verbose (and worked fine the old way)
Giving a @link without specifying the Prefix~ gives the same problem as above. npm run doc handles it fine, but eslint wants the Prefix~ added. Perhaps we should fix that as well. Example:
Example:
The line
@return {DropdownOptions[]} Dropdown options
warns withThe type 'DropdownOptions' is undefined.eslintjsdoc/no-undefined-types
The eslint warning can be fixed by changing this to
@return {mw.widgets.NamespaceInputWidget~DropdownOptions[]} Dropdown options
, but this has downsides:npm run doc
) more verbose (and worked fine the old way)When running
npm run doc
, omitting Prefix~ even works across files. Example: FieldSpecificationObject.Per this code review discussion, it might make more sense to fix this in eslint-config-wikimedia. Thoughts?
The text was updated successfully, but these errors were encountered: