- Linting: Apply latest eslint-plugin-jsdoc; lint properties/param defaults

master
Brett Zamir 2020-10-20 03:52:46 +08:00
parent 19342e4349
commit d03e5eeae6
7 changed files with 15 additions and 12 deletions

View File

@ -66,7 +66,10 @@ module.exports = {
// environments; see also discussion above // environments; see also discussion above
// `mocha-cleanup/no-assertions-outside-it` // `mocha-cleanup/no-assertions-outside-it`
'jsdoc/check-examples': ['warn', { 'jsdoc/check-examples': ['warn', {
rejectExampleCodeRegex: '^`' rejectExampleCodeRegex: '^`',
checkDefaults: true,
checkParams: true,
checkProperties: true
}], }],
// https://github.com/sindresorhus/eslint-plugin-unicorn/issues/453 // https://github.com/sindresorhus/eslint-plugin-unicorn/issues/453

6
package-lock.json generated
View File

@ -10082,9 +10082,9 @@
} }
}, },
"eslint-plugin-jsdoc": { "eslint-plugin-jsdoc": {
"version": "30.7.0", "version": "30.7.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-30.7.0.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-30.7.3.tgz",
"integrity": "sha512-hP6pigNXwy5sRRcsY355rj6bet4stqUQJtt//nmAtT/EdbJ+m8eX/2DBc/pdBWx0rYeTsFS5fmqnaOEHTTnuaQ==", "integrity": "sha512-slzJeKrm3vXabRYcFBpbUgWgdnATN9rNOFAr7IhmkxmR9Vk/6qN1c/IdvTqVSEctDRQ08chR+Lvk8fRayXgYZg==",
"dev": true, "dev": true,
"requires": { "requires": {
"comment-parser": "^0.7.6", "comment-parser": "^0.7.6",

View File

@ -184,7 +184,7 @@
"eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-html": "^6.1.0", "eslint-plugin-html": "^6.1.0",
"eslint-plugin-import": "^2.22.1", "eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsdoc": "^30.7.0", "eslint-plugin-jsdoc": "^30.7.3",
"eslint-plugin-markdown": "^1.0.2", "eslint-plugin-markdown": "^1.0.2",
"eslint-plugin-mocha": "^8.0.0", "eslint-plugin-mocha": "^8.0.0",
"eslint-plugin-mocha-cleanup": "^1.8.0", "eslint-plugin-mocha-cleanup": "^1.8.0",

View File

@ -53,7 +53,7 @@ export default {
/** /**
* *
* @param {string} [filename='image'] * @param {string} [filename="image"]
* @param {string} suffix To add to file name * @param {string} suffix To add to file name
* @param {string} uri * @param {string} uri
* @returns {boolean} * @returns {boolean}

View File

@ -244,9 +244,9 @@ export default function jQueryPluginJGraduate ($) {
* @typedef {PlainObject} module:jGraduate.Options * @typedef {PlainObject} module:jGraduate.Options
* @property {module:jGraduate~Paint} [paint] A Paint object object describing the paint to display initially; defaults to a new instance without options (defaults to opaque white) * @property {module:jGraduate~Paint} [paint] A Paint object object describing the paint to display initially; defaults to a new instance without options (defaults to opaque white)
* @property {external:Window} [window] * @property {external:Window} [window]
* @property {string} [window.pickerTitle='Drag markers to pick a paint'] * @property {string} [window.pickerTitle="Drag markers to pick a paint"]
* @property {PlainObject} [images] * @property {PlainObject} [images]
* @property {string} [images.clientPath='images/'] * @property {string} [images.clientPath="images/"]
* @property {"same"|"inverse"|"black"|"white"|module:jGraduate.ColorOpac} [newstop="inverse"] * @property {"same"|"inverse"|"black"|"white"|module:jGraduate.ColorOpac} [newstop="inverse"]
*/ */

View File

@ -91,7 +91,7 @@ const callbacks = [],
* Preferences. * Preferences.
* @interface module:SVGEditor.Prefs * @interface module:SVGEditor.Prefs
* @property {string} [lang="en"] Two-letter language code. The language must exist in the Editor Preferences language list. Defaults to "en" if `locale.js` detection does not detect another language. * @property {string} [lang="en"] Two-letter language code. The language must exist in the Editor Preferences language list. Defaults to "en" if `locale.js` detection does not detect another language.
* @property {module:SVGEditor.IconSize} [iconsize="s"|"m"] Size of the toolbar icons. Will default to 's' if the window height is smaller than the minimum height and 'm' otherwise. * @property {module:SVGEditor.IconSize} [iconsize="s" || "m"] Size of the toolbar icons. Will default to 's' if the window height is smaller than the minimum height and 'm' otherwise.
* @property {string} [bkgd_color="#FFF"] Color hex for canvas background color. Defaults to white. * @property {string} [bkgd_color="#FFF"] Color hex for canvas background color. Defaults to white.
* @property {string} [bkgd_url=""] Background raster image URL. This image will fill the background of the document; useful for tracing purposes. * @property {string} [bkgd_url=""] Background raster image URL. This image will fill the background of the document; useful for tracing purposes.
* @property {"embed"|"ref"} [img_save="embed"] Defines whether included raster images should be saved as Data URIs when possible, or as URL references. Settable in the Document Properties dialog. * @property {"embed"|"ref"} [img_save="embed"] Defines whether included raster images should be saved as Data URIs when possible, or as URL references. Settable in the Document Properties dialog.
@ -167,7 +167,7 @@ const callbacks = [],
* @property {boolean} [avoidClientSide=false] DEPRECATED (use `avoidClientSideDownload` instead); Used by `ext-server_opensave.js`; set to `true` if you wish to always save to server and not only as fallback when client support is lacking * @property {boolean} [avoidClientSide=false] DEPRECATED (use `avoidClientSideDownload` instead); Used by `ext-server_opensave.js`; set to `true` if you wish to always save to server and not only as fallback when client support is lacking
* @property {boolean} [avoidClientSideDownload=false] Used by `ext-server_opensave.js`; set to `true` if you wish to always save to server and not only as fallback when client support is lacking * @property {boolean} [avoidClientSideDownload=false] Used by `ext-server_opensave.js`; set to `true` if you wish to always save to server and not only as fallback when client support is lacking
* @property {boolean} [avoidClientSideOpen=false] Used by `ext-server_opensave.js`; set to `true` if you wish to always open from the server and not only as fallback when FileReader client support is lacking * @property {boolean} [avoidClientSideOpen=false] Used by `ext-server_opensave.js`; set to `true` if you wish to always open from the server and not only as fallback when FileReader client support is lacking
* @property {string[]} [extensions=module:SVGEditor~defaultExtensions] Extensions to load on startup. Use an array in `setConfig` and comma separated file names in the URL. Extension names must begin with "ext-". Note that as of version 2.7, paths containing "/", "\", or ":", are disallowed for security reasons. Although previous versions of this list would entirely override the default list, as of version 2.7, the defaults will always be added to this explicit list unless the configuration `noDefaultExtensions` is included. * @property {string[]} [extensions=[]] Extensions to load on startup. Use an array in `setConfig` and comma separated file names in the URL. Extension names must begin with "ext-". Note that as of version 2.7, paths containing "/", "\", or ":", are disallowed for security reasons. Although previous versions of this list would entirely override the default list, as of version 2.7, the defaults will always be added to this explicit list unless the configuration `noDefaultExtensions` is included. See {@link module:SVGEditor~defaultExtensions}.
* @property {string[]} [allowedOrigins=[]] Used by `ext-xdomain-messaging.js` to indicate which origins are permitted for cross-domain messaging (e.g., between the embedded editor and main editor code). Besides explicit domains, one might add '*' to allow all domains (not recommended for privacy/data integrity of your user's content!), `window.location.origin` for allowing the same origin (should be safe if you trust all apps on your domain), 'null' to allow `file:///` URL usage * @property {string[]} [allowedOrigins=[]] Used by `ext-xdomain-messaging.js` to indicate which origins are permitted for cross-domain messaging (e.g., between the embedded editor and main editor code). Besides explicit domains, one might add '*' to allow all domains (not recommended for privacy/data integrity of your user's content!), `window.location.origin` for allowing the same origin (should be safe if you trust all apps on your domain), 'null' to allow `file:///` URL usage
* @property {null|PlainObject} [colorPickerCSS=null] Object of CSS properties mapped to values (for jQuery) to apply to the color picker. See {@link http://api.jquery.com/css/#css-properties}. A `null` value (the default) will cause the CSS to default to `left` with a position equal to that of the `fill_color` or `stroke_color` element minus 140, and a `bottom` equal to 40 * @property {null|PlainObject} [colorPickerCSS=null] Object of CSS properties mapped to values (for jQuery) to apply to the color picker. See {@link http://api.jquery.com/css/#css-properties}. A `null` value (the default) will cause the CSS to default to `left` with a position equal to that of the `fill_color` or `stroke_color` element minus 140, and a `bottom` equal to 40
* @property {string} [paramurl] This was available via URL only. Allowed an un-encoded URL within the query string (use "url" or "source" with a data: URI instead) * @property {string} [paramurl] This was available via URL only. Allowed an un-encoded URL within the query string (use "url" or "source" with a data: URI instead)
@ -1686,7 +1686,7 @@ editor.init = () => {
/** /**
* @param {PlainObject} [opts={}] * @param {PlainObject} [opts={}]
* @param {boolean} [opts.cancelDeletes=false}] * @param {boolean} [opts.cancelDeletes=false]
* @returns {Promise<void>} Resolves to `undefined` * @returns {Promise<void>} Resolves to `undefined`
*/ */
async function promptImgURL ({cancelDeletes = false} = {}) { async function promptImgURL ({cancelDeletes = false} = {}) {

View File

@ -165,7 +165,7 @@ export default function jQueryPluginDBox ($, {
}; };
/** /**
* @param {string} msg Message to accompany the prompt * @param {string} msg Message to accompany the prompt
* @param {string} [defaultText=''] The default text to show for the prompt * @param {string} [defaultText=""] The default text to show for the prompt
* @returns {jQueryPluginDBox.ResultPromise} * @returns {jQueryPluginDBox.ResultPromise}
*/ */
$.prompt = function (msg, defaultText = '') { $.prompt = function (msg, defaultText = '') {