From 048e32c886cced586fe5f6b32cb95814072c0ef2 Mon Sep 17 00:00:00 2001 From: Stanislav A Date: Wed, 28 Dec 2022 15:09:30 +0300 Subject: [PATCH] enable jsdoc/require-property-description --- .eslintrc.js | 4 +--- scripts/build-compatibility-table.js | 10 +++++----- scripts/check-sources-updates.js | 6 +++--- src/helpers/get-property-in-chain.js | 6 +++--- src/helpers/get-wildcard-property-in-chain.js | 6 +++--- src/helpers/string-utils.js | 10 ++++------ src/redirects/redirects.js | 12 ++++++------ src/scriptlets/index.js | 2 +- 8 files changed, 26 insertions(+), 30 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 2cf0afdb..acfcf490 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -31,12 +31,10 @@ module.exports = { 'no-restricted-syntax': 0, // jsdoc rules 'jsdoc/check-tag-names': ['error', { definedTags: ['scriptlet', 'trustedScriptlet', 'redirect'] }], - 'jsdoc/require-param': 0, 'jsdoc/require-jsdoc': 0, 'jsdoc/require-param-description': 0, - - 'jsdoc/require-property-description': 0, // jsdoc problematics + 'jsdoc/require-param': 0, // requires params for scriptlets 'jsdoc/valid-types': 0, 'jsdoc/no-undefined-types': 0, // jsdoc questionable diff --git a/scripts/build-compatibility-table.js b/scripts/build-compatibility-table.js index 037d48be..4fb62ba6 100644 --- a/scripts/build-compatibility-table.js +++ b/scripts/build-compatibility-table.js @@ -21,15 +21,15 @@ const WIKI_COMPATIBILITY_TABLE_PATH = path.resolve( /** * @typedef {object} CompatibilityItem - * @property {string} adg - * @property {string} abp - * @property {string} ubo + * @property {string} adg AdGuard name + * @property {string} abp Adblock Plus name + * @property {string} ubo uBlock name */ /** * @typedef {object} CompatibilityData - * @property {CompatibilityItem[]} scriptlets - * @property {CompatibilityItem[]} redirects + * @property {CompatibilityItem[]} scriptlets list of scriptlets compatibility items + * @property {CompatibilityItem[]} redirects list of redirects compatibility items */ /** diff --git a/scripts/check-sources-updates.js b/scripts/check-sources-updates.js index 088fe730..47e10768 100644 --- a/scripts/check-sources-updates.js +++ b/scripts/check-sources-updates.js @@ -65,8 +65,8 @@ const getRedirectsFromTable = (platform) => { /** * @typedef {object} Diff - * @property {string[]} removed - * @property {string[]} added + * @property {string[]} added added content + * @property {string[]} removed removed content */ /** @@ -78,8 +78,8 @@ const getRedirectsFromTable = (platform) => { */ const getDiff = (oldList, newList) => { const diff = { - removed: [], added: [], + removed: [], }; diff.removed = oldList.filter((item) => ( diff --git a/src/helpers/get-property-in-chain.js b/src/helpers/get-property-in-chain.js index a0477510..8ddc0708 100644 --- a/src/helpers/get-property-in-chain.js +++ b/src/helpers/get-property-in-chain.js @@ -2,9 +2,9 @@ import { isEmptyObject } from './object-utils'; /** * @typedef Chain - * @property {object} base - * @property {string} prop - * @property {string} [chain] + * @property {object} base current chain base + * @property {string} prop current chain prop + * @property {string} [chain] string representation */ /** diff --git a/src/helpers/get-wildcard-property-in-chain.js b/src/helpers/get-wildcard-property-in-chain.js index 54acb429..b43c9063 100644 --- a/src/helpers/get-wildcard-property-in-chain.js +++ b/src/helpers/get-wildcard-property-in-chain.js @@ -1,8 +1,8 @@ /** * @typedef Chain - * @property {object} base - * @property {string} prop - * @property {string} [chain] + * @property {object} base current chain base + * @property {string} prop current chain prop + * @property {string} [chain] string representation */ /** diff --git a/src/helpers/string-utils.js b/src/helpers/string-utils.js index bf7abc0e..3c057ba2 100644 --- a/src/helpers/string-utils.js +++ b/src/helpers/string-utils.js @@ -224,8 +224,8 @@ export const isValidMatchNumber = (match) => { /** * @typedef {object} MatchData - * @property {boolean} isInvertedMatch - * @property {RegExp} matchRegexp + * @property {boolean} isInvertedMatch if matching should be inverted + * @property {RegExp} matchRegexp match value parsed into regex */ /** @@ -246,8 +246,8 @@ export const parseMatchArg = (match) => { /** * @typedef {object} DelayData - * @property {boolean} isInvertedDelayMatch - * @property {number|null} delayMatch + * @property {boolean} isInvertedDelayMatch if matching should be inverted + * @property {number|null} delayMatch parsed delay or null if delay is invalid */ /** @@ -256,8 +256,6 @@ export const parseMatchArg = (match) => { * * @param {string} delay * @returns {DelayData} `{ isInvertedDelayMatch, delayMatch }` where: - * `isInvertedDelayMatch` is boolean, - * `delayMatch` is number OR null for invalid `delay` */ export const parseDelayArg = (delay) => { const INVERT_MARKER = '!'; diff --git a/src/redirects/redirects.js b/src/redirects/redirects.js index 6ee43cbb..b89d6371 100644 --- a/src/redirects/redirects.js +++ b/src/redirects/redirects.js @@ -11,12 +11,12 @@ import jsYaml from 'js-yaml'; * } * * @typedef {object} Redirect - * @property {string} title - * @property {string} comment - * @property {string} content - * @property {string} contentType - * @property {boolean} [isBlocking] - * @property {string} [sha] + * @property {string} title resource name + * @property {string} comment resource description + * @property {string} content encoded resource content + * @property {string} contentType MIME type + * @property {boolean} [isBlocking] e.g click2load redirect + * @property {string} [sha] hash */ class Redirects { diff --git a/src/scriptlets/index.js b/src/scriptlets/index.js index 3b5ec0da..300c6b8b 100644 --- a/src/scriptlets/index.js +++ b/src/scriptlets/index.js @@ -19,7 +19,7 @@ import { getScriptletFunction } from '../../tmp/scriptlets-func'; * @property {Array} args Arguments for scriptlet function * @property {'extension'|'corelibs'|'test'} engine - * Defines the final form of scriptlet string presentation - * @property {string} [version] + * @property {string} [version] extension version * @property {boolean} [verbose] flag to enable printing to console debug information * @property {string} [ruleText] Source rule text is used for debugging purposes * @property {string} [domainName] domain name where scriptlet is applied; for debugging purposes