INCOMPLETE: Remove check types file

- Linting: `match-description`, bad returns
- Linting: Use eslint-plugin-jdsoc `preferredTypes` in place of custom file
- Linting: Remove `report-unused-disable-directives` command as have as rule
- Lintin: Avoid overly generic `Array`
- npm: Update devDep
This commit is contained in:
Brett Zamir
2019-05-24 14:44:57 +08:00
parent a7da98ca1b
commit fa4ea90c72
9 changed files with 64 additions and 21 deletions

View File

@@ -90,12 +90,14 @@ export const canvg = function (target, s, opts) {
return svg.load(ctx, s);
};
/* Todo: Reenable after ash-nazg may merge; eslint-disable jsdoc/check-types */
/**
* @param {module:canvg.CanvgOptions} opts
* @returns {object}
* @todo Flesh out exactly what object is returned here (after updating to latest and reincluding our changes here and those of StackBlur)
*/
function build (opts) {
/* Todo: Reenable after ash-nazg may merge; eslint-enable jsdoc/check-types */
const svg = {opts};
svg.FRAMERATE = 30;

View File

@@ -240,7 +240,7 @@ export default {
}
/**
* @param {Event} ev
* @returns {Promise<void>} Resolves to `undefined`
* @returns {void}
*/
function setArrowFromButton (ev) {
const parts = this.id.split('_');

View File

@@ -36,6 +36,7 @@ function addScriptAtts (script, atts) {
* @property {string} global The variable name to set on `window` (when not using the modular version)
* @property {boolean} [returnDefault=false]
*/
/* eslint-disable jsdoc/check-types */
/**
* @function module:importModule.importSetGlobalDefault
* @param {string|string[]} url
@@ -43,6 +44,7 @@ function addScriptAtts (script, atts) {
* @returns {Promise<*>} The value to which it resolves depends on the export of the targeted module.
*/
export function importSetGlobalDefault (url, config) {
/* eslint-enable jsdoc/check-types */
return importSetGlobal(url, {...config, returnDefault: true});
}
/**
@@ -111,6 +113,7 @@ export function importScript (url, atts = {}) {
});
}
/* eslint-disable jsdoc/check-types */
/**
*
* @param {string|string[]} url
@@ -121,6 +124,7 @@ export function importScript (url, atts = {}) {
* `Error` upon a script loading error.
*/
export function importModule (url, atts = {}, {returnDefault = false} = {}) {
/* eslint-enable jsdoc/check-types */
if (Array.isArray(url)) {
return Promise.all(url.map((u) => {
return importModule(u, atts);

View File

@@ -1174,7 +1174,7 @@ editor.init = function () {
};
/**
* Setup SVG icons
* Setup SVG icons.
* @returns {void}
*/
function setIcons () {
@@ -1551,7 +1551,7 @@ editor.init = function () {
/**
* This function highlights the layer passed in (by fading out the other layers).
* If no layer is passed in, this function restores the other layers
* If no layer is passed in, this function restores the other layers.
* @param {string} [layerNameToHighlight]
* @returns {void}
*/
@@ -5961,7 +5961,7 @@ editor.init = function () {
);
/**
* Implements {@see module:jQueryContextMenu.jQueryContextMenuListener}
* Implements {@see module:jQueryContextMenu.jQueryContextMenuListener}.
* @param {"dupe"|"delete"|"merge_down"|"merge_all"} action
* @param {external:jQuery} el
* @param {{x: Float, y: Float, docX: Float, docY: Float}} pos
@@ -6146,7 +6146,7 @@ editor.init = function () {
reader = new FileReader();
reader.onloadend = function ({target: {result}}) {
/**
* Insert the new image until we know its dimensions
* Insert the new image until we know its dimensions.
* @param {Float} width
* @param {Float} height
* @returns {void}

View File

@@ -123,6 +123,7 @@ let listMap_ = {};
export class SVGTransformList { // eslint-disable-line no-shadow
/**
* @param {Element} elem
* @returns {SVGTransformList}
*/
constructor (elem) {
this._elem = elem || null;
@@ -208,7 +209,7 @@ export class SVGTransformList { // eslint-disable-line no-shadow
/**
* @param {SVGTransform} newItem
* @returns {SVGTransform}
* @returns {void}
*/
initialize (newItem) {
this.numberOfItems = 1;