From a7da98ca1bf662165ffb281b6da02c193483af3e Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Fri, 24 May 2019 10:12:10 +0800 Subject: [PATCH] - Linting (ESLint): Avoid unneeded tag name preference - Linting (jsdoc): Avoid `Promise` without type --- .eslintrc.js | 4 ---- editor/canvg/canvg.js | 2 +- jsdoc-check-overly-generic-types.js | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 7debacba..cc365c75 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -50,10 +50,6 @@ module.exports = { // In case we need to extend customTags: [] }, - tagNamePreference: { - arg: "param", - return: "returns" - }, allowOverrideWithoutParam: true, allowImplementsWithoutParam: true, allowAugmentsExtendsWithoutParam: true, diff --git a/editor/canvg/canvg.js b/editor/canvg/canvg.js index f661176c..6ba09708 100644 --- a/editor/canvg/canvg.js +++ b/editor/canvg/canvg.js @@ -47,7 +47,7 @@ const isNullish = (val) => { * @param {HTMLCanvasElement|string} target canvas element or the id of a canvas element * @param {string|XMLDocument} s - svg string, url to svg file, or xml document * @param {module:canvg.CanvgOptions} [opts] Optional hash of options -* @returns {Promise} All the function after the first render is completed with dom +* @returns {Promise} All the function after the first render is completed with dom */ export const canvg = function (target, s, opts) { // no parameters diff --git a/jsdoc-check-overly-generic-types.js b/jsdoc-check-overly-generic-types.js index 31183d2c..de970e4c 100644 --- a/jsdoc-check-overly-generic-types.js +++ b/jsdoc-check-overly-generic-types.js @@ -21,7 +21,7 @@ let results = await Promise.all(fileMatchPatterns.map((fileMatchPattern) => { { // We grab to the end of the line as the `line` result for `find-in-files` // only grabs from the beginning of the file to the end of the match. - term: `(@[^{\\n]*{[^}\\n]*(\\bobject|\\barray\\b|[^.]function|\\bnumber|\\*)[^}\\n]*}|@.*{} ).*`, + term: `(@[^{\\n]*{[^}\\n]*(\\bobject|Promise(?!<|Result)|\\barray\\b|[^.]function|\\bnumber|\\*)[^}\\n]*}|@.*{} ).*`, flags: 'gi' }, fileMatchPattern,