npm update

master
JFH 2021-02-23 23:39:14 +01:00
parent 9bac20edd2
commit 82ed16c983
15 changed files with 2463 additions and 987 deletions

View File

@ -1,127 +1,215 @@
'use strict'; "use strict";
module.exports = { module.exports = {
plugins: ["html"], extends: [
extends: ["plugin:markdown/recommended","eslint:recommended"], "plugin:compat/recommended",
"plugin:node/recommended",
"plugin:no-unsanitized/DOM",
"plugin:promise/recommended",
"plugin:import/errors",
"plugin:markdown/recommended",
"plugin:sonarjs/recommended"
],
plugins: ["jsdoc", "promise", "html", "import", "sonarjs"],
parserOptions: { parserOptions: {
ecmaVersion: 2020, ecmaVersion: 2020,
sourceType: 'module' sourceType: "module"
}, },
env: { env: {
browser: true, browser: true,
es6: true, es6: true
node: true
}, },
settings: { settings: {
polyfills: [ polyfills: [
// These are the primary polyfills needed by regular users if // These are the primary polyfills needed by regular users if
// not present, e.g., with core-js-bundle; also those under // not present, e.g., with core-js-bundle; also those under
// extensions // extensions
'fetch', "fetch",
'Promise', "Promise",
'Promise.all', "Promise.all",
'Uint8Array', // 'Set',
'URL' "Uint8Array",
"URL"
] ]
}, },
rules: { rules: {
// check-examples is not picking up eslint config properly in some // check-examples is not picking up eslint config properly in some
// environments; see also discussion above // environments; see also discussion above
// `mocha-cleanup/no-assertions-outside-it` // `mocha-cleanup/no-assertions-outside-it`
'no-unused-vars': ["error", { "args": "none" }], "sonarjs/cognitive-complexity": 0,
"sonarjs/no-duplicate-string": 0,
"sonarjs/no-collapsible-if": 0,
"sonarjs/no-small-switch": 0,
"sonarjs/no-identical-functions": 0,
"sonarjs/no-duplicated-branches": 0,
"jsdoc/check-examples": [
"warn",
{
rejectExampleCodeRegex: "^`",
checkDefaults: true,
checkParams: true,
checkProperties: true
}
],
// The Babel transform seems to have a problem converting these // The Babel transform seems to have a problem converting these
'prefer-named-capture-group': 'off', "prefer-named-capture-group": "off",
"jsdoc/require-file-overview": [
"error",
{
tags: {
file: {
initialCommentsOnly: true,
preventDuplicates: true
},
license: {
initialCommentsOnly: true,
preventDuplicates: true
},
copyright: {
initialCommentsOnly: true,
preventDuplicates: true
},
author: {
initialCommentsOnly: true,
preventDuplicates: true
},
module: {
initialCommentsOnly: true,
preventDuplicates: true
},
exports: {
initialCommentsOnly: true,
preventDuplicates: true
}
}
}
],
// Warning or Off for now but should be reviewed // Warning or Off for now but should be reviewed
// Override these rules which are difficult for us // Override these rules which are difficult for us
// to apply at this time // to apply at this time
'default-case': 'off', "default-case": "off",
'require-unicode-regexp': 'off', "require-unicode-regexp": "off",
'max-len': "max-len": ["warn", { ignoreComments: true, code: 130 }], // 130 is too much but too many occurences
[ "eslint-comments/require-description": "off",
'warn', "compat/compat": "error",
{ignoreComments: true, code: 130} "consistent-this": "off",
], // 130 is too much but too many occurences "import/no-anonymous-default-export": "off",
'eslint-comments/require-description': 'off', "node/no-unsupported-features/node-builtins": "warn",
'consistent-this': 'off', "prefer-exponentiation-operator": "warn",
'import/no-anonymous-default-export': 'off', "node/no-unsupported-features/es-syntax": "off",
'prefer-exponentiation-operator': 'warn' "no-unsanitized/method": [
"error",
{
escape: {
methods: ["encodeURIComponent", "encodeURI"]
}
}
]
}, },
overrides: [ overrides: [
// Locales have no need for importing outside of SVG-Edit // Locales have no need for importing outside of SVG-Edit
// and translations may need a longer line length // and translations may need a longer line length
{ {
files: [ files: [
'src/editor/locale/lang.*.js', 'src/editor/extensions/*/locale/**' 'src/editor/locale/lang.*.js',
'src/editor/extensions/*/locale/**',
'docs/tutorials/ExtensionDocs.md/*.js'
], ],
rules: { rules: {
'import/no-anonymous-default-export': 'off', "import/no-anonymous-default-export": "off",
'max-len': 'off' "max-len": "off",
"node/no-missing-import": "off",
"import/no-unresolved": "off"
}
},
// These browser files don't do importing or requiring
{
files: [
"src/editor/touch.js",
"src/editor/typedefs.js",
"src/editor/redirect-on-no-module-support.js",
"src/editor/extensions/ext-imagelib/index.js",
"screencasts/svgopen2010/script.js"
],
rules: {
"import/unambiguous": ["off"]
} }
}, },
{ {
files: ['.eslintrc.js', '.ncurc.js', 'tools/mochawesome-cli.js'] files: ["**/*.html", "screencasts/**"],
}, globals: {
// Our Markdown rules (and used for JSDoc examples as well, by way of root: "off"
// our use of `jsdoc/check-examples` within `ash-nazg`) },
{ settings: {
files: ["**/*.md/*.js"], polyfills: [
"document.querySelector",
"history",
"history.pushState",
"history.replaceState",
"location.hash",
"navigator",
"Number.parseFloat",
"Number.parseInt",
"Number.isNaN"
]
},
rules: { rules: {
"no-undef": 'off' "import/unambiguous": "off"
} }
}, },
{ {
// As consumed by jsdoc, cannot be expressed as ESM // As consumed by jsdoc, cannot be expressed as ESM
files: ['docs/jsdoc-config.js'], files: ["docs/jsdoc-config.js"],
parserOptions: { parserOptions: {
sourceType: 'script' sourceType: "script"
}, },
globals: { globals: {
module: false module: false
}, },
rules: { rules: {
'import/no-commonjs': 'off', "import/no-commonjs": "off",
strict: 'off' strict: "off"
} }
}, },
{ {
files: ['cypress/plugins/index.js'] files: ["cypress/**"],
},
{
files: ['cypress/**'],
extends: [ extends: [
'plugin:cypress/recommended', "plugin:cypress/recommended",
'plugin:mocha/recommended', "plugin:mocha/recommended",
'plugin:mocha-cleanup/recommended-no-limits', "plugin:mocha-cleanup/recommended-no-limits",
'plugin:@fintechstudios/chai-as-promised/recommended', "plugin:@fintechstudios/chai-as-promised/recommended",
'plugin:chai-expect-keywords/recommended', "plugin:chai-expect-keywords/recommended",
'plugin:chai-expect/recommended', "plugin:chai-expect/recommended",
'plugin:chai-friendly/recommended' "plugin:chai-friendly/recommended"
], ],
env: { env: {
node: true node: true
}, },
settings: { settings: {
polyfills: [ polyfills: [
'console', "console",
'Date.now', "Date.now",
'document.body', "document.body",
'document.createElementNS', "document.createElementNS",
'document.head', "document.head",
'DOMParser', "DOMParser",
'Number.isNaN', "Number.isNaN",
'Object.keys', "Object.keys",
'Object.entries', "Object.entries",
'Promise' "Promise"
] ]
}, },
rules: { rules: {
// These errors are caused in Cypress files if user has not // These errors are caused in Cypress files if user has not
// yet instrumented code; need to reinvestigate why we had to // yet instrumented code; need to reinvestigate why we had to
// instrument separately from nyc mocha // instrument separately from nyc mocha
'node/no-missing-import': 'off', "import/no-unresolved": ["error", { ignore: ["/instrumented/"] }],
'jsdoc/check-examples': 'off', "node/no-missing-import": "off",
'chai-expect-keywords/no-unsupported-keywords': [ "jsdoc/check-examples": "off",
'error', { "chai-expect-keywords/no-unsupported-keywords": [
"error",
{
allowChaiDOM: true allowChaiDOM: true
} }
], ],
@ -131,50 +219,51 @@ module.exports = {
// Good but would be difficult to enforce (and data-* may not be less // Good but would be difficult to enforce (and data-* may not be less
// brittle than IDs/classes anyways) // brittle than IDs/classes anyways)
// 'cypress/require-data-selectors': 0, // 'cypress/require-data-selectors': 0,
'cypress/assertion-before-screenshot': 2, "cypress/assertion-before-screenshot": 2,
// Conflicts with Cypress `should` // Conflicts with Cypress `should`
'mocha-cleanup/invalid-assertions': 0, "mocha-cleanup/invalid-assertions": 0,
// Might see about working around to avoid the option limitation, // Might see about working around to avoid the option limitation,
// but convenient // but convenient
'mocha-cleanup/no-expressions-in-assertions': ['error', { "mocha-cleanup/no-expressions-in-assertions": [
replacementsOnly: true "error",
}], {
replacementsOnly: true
}
],
// Too oppressive when planning to extend a section // Too oppressive when planning to extend a section
'mocha/no-hooks-for-single-case': 0, "mocha/no-hooks-for-single-case": 0,
// Would be good to enable but needs some refactoring // Would be good to enable but needs some refactoring
'mocha/no-setup-in-describe': 0, "mocha/no-setup-in-describe": 0,
'mocha-cleanup/no-outside-declaration': 0, "mocha-cleanup/no-outside-declaration": 0,
// Useful to ensure allowing `this.timeout()`, etc., but a // Useful to ensure allowing `this.timeout()`, etc., but a
// little oppressive // little oppressive
'mocha/no-mocha-arrows': 0, "mocha/no-mocha-arrows": 0,
// Useful if enabling the regular `prefer-arrow-callback` // Useful if enabling the regular `prefer-arrow-callback`
// 'mocha/prefer-arrow-callback': 2 // 'mocha/prefer-arrow-callback': 2
'jsdoc/require-jsdoc': 0, "jsdoc/require-jsdoc": 0,
'no-console': 0, "no-console": 0,
'import/unambiguous': 0 "import/unambiguous": 0
} }
}, },
{ {
// Node files // Node files
files: [ files: [
'docs/jsdoc-config.js', "docs/jsdoc-config.js",
'build/build-html.js', "build/build-html.js",
'rollup.config.js', 'rollup-config.config.js' "rollup.config.js",
"rollup-config.config.js"
], ],
env: { env: {
node: true node: true
}, },
settings: { settings: {
polyfills: [ polyfills: ["console", "Promise.resolve"]
'console',
'Promise.resolve'
]
}, },
globals: { globals: {
require: true require: true
@ -184,7 +273,8 @@ module.exports = {
// and we have too many modules to add to `peerDependencies` // and we have too many modules to add to `peerDependencies`
// so this rule can know them to be available, so we instead // so this rule can know them to be available, so we instead
// disable // disable
"node/no-unpublished-import": "off"
} }
} }
] ]
}; };

3101
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -138,7 +138,8 @@
"@babel/polyfill": "7.12.1", "@babel/polyfill": "7.12.1",
"@web/dev-server-rollup": "0.3.2", "@web/dev-server-rollup": "0.3.2",
"canvg": "3.0.7", "canvg": "3.0.7",
"core-js": "3.8.3", "core-js": "3.9.0",
"elix": "^15.0.0",
"jspdf": "2.3.0", "jspdf": "2.3.0",
"pathseg": "1.2.0", "pathseg": "1.2.0",
"regenerator-runtime": "0.13.7", "regenerator-runtime": "0.13.7",
@ -146,67 +147,67 @@
"svg2pdf.js": "2.1.0" "svg2pdf.js": "2.1.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "7.12.10", "@babel/core": "7.13.1",
"@babel/preset-env": "7.12.11", "@babel/preset-env": "7.13.5",
"@babel/register": "7.12.10", "@babel/register": "7.13.0",
"@babel/runtime-corejs3": "7.12.5", "@babel/runtime-corejs3": "7.13.6",
"@cypress/code-coverage": "3.9.2", "@cypress/code-coverage": "3.9.2",
"@cypress/fiddle": "1.19.1", "@cypress/fiddle": "1.19.2",
"@fintechstudios/eslint-plugin-chai-as-promised": "3.0.2", "@fintechstudios/eslint-plugin-chai-as-promised": "3.0.2",
"@hkdobrev/run-if-changed": "0.3.1", "@hkdobrev/run-if-changed": "0.3.1",
"@mysticatea/eslint-plugin": "13.0.0", "@mysticatea/eslint-plugin": "13.0.0",
"@rollup/plugin-babel": "5.2.3", "@rollup/plugin-babel": "5.3.0",
"@rollup/plugin-commonjs": "^17.1.0", "@rollup/plugin-commonjs": "17.1.0",
"@rollup/plugin-dynamic-import-vars": "1.1.1", "@rollup/plugin-dynamic-import-vars": "1.1.1",
"@rollup/plugin-node-resolve": "11.1.1", "@rollup/plugin-node-resolve": "11.2.0",
"@rollup/plugin-replace": "2.3.4", "@rollup/plugin-replace": "2.4.1",
"@rollup/plugin-url": "6.0.0", "@rollup/plugin-url": "6.0.0",
"@web/dev-server": "0.1.5", "@web/dev-server": "^0.1.8",
"axe-core": "4.1.1", "axe-core": "4.1.2",
"babel-plugin-transform-object-rest-spread": "7.0.0-beta.3", "babel-plugin-transform-object-rest-spread": "7.0.0-beta.3",
"copyfiles": "2.4.1", "copyfiles": "2.4.1",
"core-js-bundle": "3.8.3", "core-js-bundle": "3.9.0",
"coveradge": "0.6.0", "coveradge": "0.6.0",
"cp-cli": "2.0.0", "cp-cli": "2.0.0",
"cross-var": "1.1.0", "cross-var": "1.1.0",
"cypress": "6.3.0", "cypress": "6.5.0",
"cypress-axe": "0.12.0", "cypress-axe": "0.12.2",
"cypress-multi-reporters": "1.4.0", "cypress-multi-reporters": "1.4.0",
"cypress-plugin-snapshots": "1.4.4", "cypress-plugin-snapshots": "1.4.4",
"deparam": "git+https://github.com/brettz9/deparam.git#updates", "deparam": "git+https://github.com/brettz9/deparam.git#updates",
"elix": "^14.1.2", "eslint": "^7.20.0",
"eslint": "^7.19.0",
"eslint-config-standard": "16.0.2", "eslint-config-standard": "16.0.2",
"eslint-plugin-array-func": "3.1.7", "eslint-plugin-array-func": "3.1.7",
"eslint-plugin-chai-expect": "2.2.0", "eslint-plugin-chai-expect": "2.2.0",
"eslint-plugin-chai-expect-keywords": "2.0.1", "eslint-plugin-chai-expect-keywords": "2.1.0",
"eslint-plugin-chai-friendly": "0.6.0", "eslint-plugin-chai-friendly": "0.6.0",
"eslint-plugin-compat": "3.9.0", "eslint-plugin-compat": "^3.9.0",
"eslint-plugin-cypress": "2.11.2", "eslint-plugin-cypress": "2.11.2",
"eslint-plugin-eslint-comments": "3.2.0", "eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-html": "^6.1.1", "eslint-plugin-html": "^6.1.1",
"eslint-plugin-import": "2.22.1", "eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsdoc": "31.6.0", "eslint-plugin-jsdoc": "^32.2.0",
"eslint-plugin-markdown": "^2.0.0-rc.2", "eslint-plugin-markdown": "^2.0.0",
"eslint-plugin-mocha": "8.0.0", "eslint-plugin-mocha": "8.0.0",
"eslint-plugin-mocha-cleanup": "1.9.1", "eslint-plugin-mocha-cleanup": "1.9.1",
"eslint-plugin-no-unsanitized": "3.1.4", "eslint-plugin-no-unsanitized": "^3.1.4",
"eslint-plugin-no-use-extend-native": "0.5.0", "eslint-plugin-no-use-extend-native": "0.5.0",
"eslint-plugin-node": "11.1.0", "eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "4.2.1", "eslint-plugin-promise": "^4.3.1",
"eslint-plugin-sonarjs": "0.5.0", "eslint-plugin-sonarjs": "^0.6.0",
"eslint-plugin-standard": "4.1.0", "eslint-plugin-standard": "4.1.0",
"husky": "4.3.8", "eslint-plugin-unicorn": "28.0.2",
"husky": "5.1.1",
"imageoptim-cli": "3.0.2", "imageoptim-cli": "3.0.2",
"jamilih": "0.53.2", "jamilih": "0.54.0",
"jsdoc": "3.6.6", "jsdoc": "3.6.6",
"license-badger": "0.18.0", "license-badger": "0.18.0",
"lint-staged": "10.5.3", "lint-staged": "10.5.4",
"mocha": "8.2.1", "mocha": "8.3.0",
"mocha-badge-generator": "0.9.0", "mocha-badge-generator": "0.9.0",
"mochawesome": "6.2.1", "mochawesome": "6.2.2",
"mochawesome-merge": "4.2.0", "mochawesome-merge": "4.2.0",
"mochawesome-report-generator": "5.1.0", "mochawesome-report-generator": "5.2.0",
"node-static": "0.7.11", "node-static": "0.7.11",
"npm-run-all": "4.1.5", "npm-run-all": "4.1.5",
"nyc": "15.1.0", "nyc": "15.1.0",
@ -218,16 +219,16 @@
"remark-lint-ordered-list-marker-value": "2.0.1", "remark-lint-ordered-list-marker-value": "2.0.1",
"requirejs": "2.3.6", "requirejs": "2.3.6",
"rimraf": "3.0.2", "rimraf": "3.0.2",
"rollup": "2.38.2", "rollup": "2.39.1",
"rollup-plugin-copy": "3.3.0", "rollup-plugin-copy": "3.4.0",
"rollup-plugin-filesize": "9.1.0", "rollup-plugin-filesize": "9.1.0",
"rollup-plugin-node-polyfills": "0.2.1", "rollup-plugin-node-polyfills": "0.2.1",
"rollup-plugin-progress": "1.1.2", "rollup-plugin-progress": "1.1.2",
"rollup-plugin-re": "1.0.7", "rollup-plugin-re": "1.0.7",
"rollup-plugin-terser": "7.0.2", "rollup-plugin-terser": "7.0.2",
"stackblur-canvas": "2.4.0", "stackblur-canvas": "2.5.0",
"systemjs": "6.8.3", "systemjs": "6.8.3",
"typescript": "4.1.3", "typescript": "4.2.2",
"underscore": "1.12.0" "underscore": "1.12.0"
} }
} }

View File

@ -9,7 +9,7 @@ import babel from '@rollup/plugin-babel';
import copy from 'rollup-plugin-copy'; import copy from 'rollup-plugin-copy';
import {nodeResolve} from '@rollup/plugin-node-resolve'; import {nodeResolve} from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs'; import commonjs from '@rollup/plugin-commonjs';
import nodePolyfills from 'rollup-plugin-polyfill-node'; import nodePolyfills from 'rollup-plugin-node-polyfills';
import url from '@rollup/plugin-url'; // for XML/SVG files import url from '@rollup/plugin-url'; // for XML/SVG files
import dynamicImportVars from '@rollup/plugin-dynamic-import-vars'; import dynamicImportVars from '@rollup/plugin-dynamic-import-vars';
import {terser} from 'rollup-plugin-terser'; import {terser} from 'rollup-plugin-terser';

View File

@ -1,5 +1,6 @@
/* globals $ */ /* globals $ */
// eslint-disable-next-line node/no-unpublished-import
import deparam from 'deparam'; import deparam from 'deparam';
/** /**

View File

@ -1,5 +1,4 @@
/* eslint-disable max-len */ /* eslint-disable max-len */
/* eslint-disable unicorn/prefer-math-trunc */
/* eslint-disable no-bitwise */ /* eslint-disable no-bitwise */
/** /**
* @external Math * @external Math

View File

@ -1,6 +1,4 @@
/* eslint-disable unicorn/prefer-math-trunc */
/* eslint-disable no-bitwise */ /* eslint-disable no-bitwise */
/* eslint-disable unicorn/prefer-ternary */
import {findPos} from './Util.js'; import {findPos} from './Util.js';
/** /**
* Whether a value is `null` or `undefined`. * Whether a value is `null` or `undefined`.

View File

@ -1,5 +1,4 @@
/* eslint-disable no-loop-func */ /* eslint-disable no-loop-func */
/* eslint-disable unicorn/prefer-node-remove */
/* eslint-disable prefer-destructuring */ /* eslint-disable prefer-destructuring */
/* eslint-disable no-unsanitized/property */ /* eslint-disable no-unsanitized/property */
/** /**

View File

@ -1,3 +1,4 @@
/* eslint-disable no-unsanitized/property */
/** /**
* @file jPicker (Adapted from version 1.1.6) * @file jPicker (Adapted from version 1.1.6)
* *

View File

@ -1,3 +1,4 @@
/* eslint-disable no-unsanitized/property */
const template = document.createElement('template'); const template = document.createElement('template');
template.innerHTML = ` template.innerHTML = `
<style> <style>

View File

@ -110,6 +110,7 @@ svgCanvas.setSvgString('string');
svgCanvas.setSvgString('string')(function (data, error) { svgCanvas.setSvgString('string')(function (data, error) {
if (error) { if (error) {
// There was an error // There was an error
throw error
} else { } else {
// Handle data // Handle data
} }

View File

@ -1,3 +1,4 @@
/* eslint-disable node/no-unpublished-import */
import {jml, body, nbsp} from 'jamilih'; import {jml, body, nbsp} from 'jamilih';
import $ from 'query-result'; import $ from 'query-result';
import {manipulation} from 'qr-manipulation'; import {manipulation} from 'qr-manipulation';

View File

@ -1010,11 +1010,10 @@ class Editor extends EditorStartup {
*/ */
// eslint-disable-next-line class-methods-use-this // eslint-disable-next-line class-methods-use-this
makeFlyoutHolder (id, child) { makeFlyoutHolder (id, child) {
const div = $('<div>', { return $('<div>', {
class: 'tools_flyout', class: 'tools_flyout',
id id
}).appendTo('#svg_editor').append(child); }).appendTo('#svg_editor').append(child);
return div;
} }
/** /**

View File

@ -1,11 +1,12 @@
/* globals jQuery */
import {jGraduate} from '../editor/components/jgraduate/jQuery.jGraduate.js';
/** /**
* @module elem-get-set get and set methods. * @module elem-get-set get and set methods.
* @license MIT * @license MIT
* @copyright 2011 Jeff Schiller * @copyright 2011 Jeff Schiller
*/ */
/* globals jQuery */
import {jGraduate} from '../editor/components/jgraduate/jQuery.jGraduate.js';
import * as hstry from './history.js'; import * as hstry from './history.js';
import jQueryPluginSVG from './jQuery.attr.js'; import jQueryPluginSVG from './jQuery.attr.js';
import {NS} from '../common/namespaces.js'; import {NS} from '../common/namespaces.js';

View File

@ -2708,7 +2708,7 @@ class SvgCanvas {
* @returns {module:svgcanvas.PrivateMethods} * @returns {module:svgcanvas.PrivateMethods}
*/ */
this.getPrivateMethods = function () { this.getPrivateMethods = function () {
const obj = { return {
addCommandToHistory, addCommandToHistory,
BatchCommand, BatchCommand,
ChangeElementCommand, ChangeElementCommand,
@ -2737,7 +2737,6 @@ class SvgCanvas {
transformPoint, transformPoint,
walkTree walkTree
}; };
return obj;
}; };
} // End constructor } // End constructor
} // End class } // End class