upgrade and fix associated issues

This commit is contained in:
JFH
2021-02-14 19:14:59 +01:00
parent 116a86138f
commit da87bae1ee
12 changed files with 3048 additions and 3329 deletions

View File

@@ -1,10 +1,19 @@
'use strict'; "use strict";
module.exports = { module.exports = {
extends: ['ash-nazg/sauron-node'], extends: [
"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,
@@ -15,123 +24,85 @@ module.exports = {
// 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
// 'Array.isArray', "fetch",
// 'Blob', "Promise",
// 'console', "Promise.all",
// 'CustomEvent',
// 'document.body',
// 'document.createElementNS',
// 'document.evaluate',
// 'document.head',
// 'document.importNode',
// 'document.querySelector',
// 'document.querySelectorAll',
// 'DOMParser',
// 'Error',
'fetch',
// 'FileReader',
// 'JSON',
// 'KeyboardEvent',
// 'location.href',
// 'location.origin',
// 'MouseEvent',
// 'MutationObserver',
// 'navigator',
// 'Number.isNaN',
// 'Number.parseFloat',
// 'Number.parseInt',
// 'Object.assign',
// 'Object.defineProperty',
// 'Object.defineProperties',
// 'Object.entries',
// 'Object.getOwnPropertyDescriptor',
// 'Object.keys',
// 'Object.values',
'Promise',
'Promise.all',
// 'Set', // 'Set',
'Uint8Array', "Uint8Array",
'URL' "URL"
// 'URL.createObjectURL',
// 'XMLSerializer',
// 'XMLHttpRequest',
// 'window.getComputedStyle',
// 'window.parent',
// 'window.scrollX',
// 'window.scrollY'
] ]
}, },
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`
'jsdoc/check-examples': ['warn', { "sonarjs/cognitive-complexity": 0,
rejectExampleCodeRegex: '^`', "sonarjs/no-duplicate-string": 0,
checkDefaults: true, "sonarjs/no-collapsible-if": 0,
checkParams: true, "sonarjs/no-small-switch": 0,
checkProperties: true "sonarjs/no-identical-functions": 0,
}], "sonarjs/no-duplicated-branches": 0,
// https://github.com/sindresorhus/eslint-plugin-unicorn/issues/453 "jsdoc/check-examples": [
'unicorn/regex-shorthand': 0, "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', { "jsdoc/require-file-overview": [
tags: { "error",
file: { {
initialCommentsOnly: true, tags: {
preventDuplicates: true file: {
}, initialCommentsOnly: true,
license: { preventDuplicates: true
initialCommentsOnly: true, },
preventDuplicates: true license: {
}, initialCommentsOnly: true,
copyright: { preventDuplicates: true
initialCommentsOnly: true, },
preventDuplicates: true copyright: {
}, initialCommentsOnly: true,
author: { preventDuplicates: true
initialCommentsOnly: true, },
preventDuplicates: true author: {
}, initialCommentsOnly: true,
module: { preventDuplicates: true
initialCommentsOnly: true, },
preventDuplicates: true module: {
}, initialCommentsOnly: true,
exports: { preventDuplicates: true
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
'unicorn/prefer-string-slice': 'off', "default-case": "off",
'default-case': 'off', "require-unicode-regexp": "off",
'require-unicode-regexp': 'off', "max-len": ["warn", { ignoreComments: true, code: 130 }], // 130 is too much but too many occurences
'max-len': "eslint-comments/require-description": "off",
[ "compat/compat": "error",
'warn', "consistent-this": "off",
{ignoreComments: true, code: 130} "import/no-anonymous-default-export": "off",
], // 130 is too much but too many occurences "node/no-unsupported-features/node-builtins": "warn",
'unicorn/prefer-query-selector': 'off', "prefer-exponentiation-operator": "warn",
'unicorn/no-fn-reference-in-iterator': 'off', "node/no-unsupported-features/es-syntax": "off",
'unicorn/prefer-node-append': 'off', "no-unsanitized/method": [
'unicorn/no-zero-fractions': 'off', "error",
'unicorn/prefer-number-properties': 'off',
'eslint-comments/require-description': 'off',
'compat/compat': 'error',
'consistent-this': 'off',
'import/no-anonymous-default-export': 'off',
'node/no-unsupported-features/node-builtins': 'warn',
'prefer-exponentiation-operator': 'warn',
'node/no-unsupported-features/es-syntax': 'off',
'no-unsanitized/method': [
'error',
{ {
escape: { escape: {
methods: ['encodeURIComponent', 'encodeURI'] methods: ["encodeURIComponent", "encodeURI"]
} }
} }
] ]
@@ -141,147 +112,104 @@ module.exports = {
// 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',
'docs/tutorials/ExtensionDocs.md' '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 // These browser files don't do importing or requiring
{ {
files: [ files: [
'src/editor/touch.js', "src/editor/touch.js",
'src/editor/typedefs.js', "src/editor/typedefs.js",
'src/editor/redirect-on-no-module-support.js', "src/editor/redirect-on-no-module-support.js",
'src/editor/extensions/ext-imagelib/index.js', "src/editor/extensions/ext-imagelib/index.js",
'screencasts/svgopen2010/script.js' "screencasts/svgopen2010/script.js"
], ],
rules: { rules: {
'import/unambiguous': ['off'] "import/unambiguous": ["off"]
} }
}, },
{ {
files: ['**/*.html', 'screencasts/**'], files: ["**/*.html", "screencasts/**"],
globals: { globals: {
root: 'off' root: "off"
}, },
settings: { settings: {
polyfills: [ polyfills: [
'document.querySelector', "document.querySelector",
'history', "history",
'history.pushState', "history.pushState",
'history.replaceState', "history.replaceState",
'location.hash', "location.hash",
'navigator', "navigator",
'Number.parseFloat', "Number.parseFloat",
'Number.parseInt', "Number.parseInt",
'Number.isNaN' "Number.isNaN"
] ]
}, },
rules: { rules: {
'import/unambiguous': 'off' "import/unambiguous": "off"
}
},
{
files: ['.eslintrc.js', '.ncurc.js', 'tools/mochawesome-cli.js'],
extends: [
'ash-nazg/sauron-node-script'
]
},
// Our Markdown rules (and used for JSDoc examples as well, by way of
// our use of `jsdoc/check-examples` within `ash-nazg`)
{
files: ['**/*.md'],
settings: {
polyfills: [
// Tutorials
'console',
'location.href'
]
},
rules: {
// Todo: Figure out why this is not enough to disable warning
// for examples in my environment (but it is in others')
// Used in examples of assert-close.js plugin
'mocha-cleanup/no-assertions-outside-it': 'off',
'eslint-comments/no-unused-disable': 'warn',
'eol-last': ['off'],
'no-console': ['off'],
'no-undef': ['off'],
'no-unused-vars': ['warn'],
'padded-blocks': ['off'],
'import/unambiguous': ['off'],
'import/no-unresolved': ['off'],
'node/no-missing-import': ['off'],
'no-multi-spaces': 'off',
'sonarjs/no-all-duplicated-branches': 'off',
'node/no-unpublished-import': ['error', {
allowModules: ['@cypress/fiddle']
}],
'no-alert': 'off',
// Disable until may fix https://github.com/gajus/eslint-plugin-jsdoc/issues/211
indent: '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/**"],
extends: [ extends: [
'ash-nazg/sauron-node-script' "plugin:cypress/recommended",
] "plugin:mocha/recommended",
}, "plugin:mocha-cleanup/recommended-no-limits",
{ "plugin:@fintechstudios/chai-as-promised/recommended",
files: ['cypress/**'], "plugin:chai-expect-keywords/recommended",
extends: [ "plugin:chai-expect/recommended",
'plugin:cypress/recommended', "plugin:chai-friendly/recommended"
'plugin:mocha/recommended',
'plugin:mocha-cleanup/recommended-no-limits',
'plugin:@fintechstudios/chai-as-promised/recommended',
'plugin:chai-expect-keywords/recommended',
'plugin:chai-expect/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
'import/no-unresolved': ['error', {ignore: ['/instrumented/']}], "import/no-unresolved": ["error", { ignore: ["/instrumented/"] }],
'node/no-missing-import': 'off', "node/no-missing-import": "off",
'jsdoc/check-examples': 'off', "jsdoc/check-examples": "off",
'chai-expect-keywords/no-unsupported-keywords': [ "chai-expect-keywords/no-unsupported-keywords": [
'error', { "error",
{
allowChaiDOM: true allowChaiDOM: true
} }
], ],
@@ -291,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
@@ -344,7 +273,7 @@ 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' "node/no-unpublished-import": "off"
} }
} }
] ]

View File

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="421" height="20"><defs><style>text{font-size:11px;font-family:Verdana,DejaVu Sans,Geneva,sans-serif}text.shadow{fill:#010101;fill-opacity:.3}text.high{fill:#fff}</style><linearGradient id="smooth" x2="0" y2="100%"><stop offset="0" stop-color="#aaa" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="round"><rect width="100%" height="100%" rx="3" fill="#fff"/></mask></defs><g id="bg" mask="url(#round)"><path fill="green" stroke="#000" d="M0 0h120v20H0zM120 0h102v20H120zM222 0h87v20h-87zM309 0h112v20H309z"/><path fill="url(#smooth)" d="M0 0h421v20H0z"/></g><g id="fg"><text class="shadow" x="5.5" y="15">Statements 52.79%</text><text class="high" x="5" y="14">Statements 52.79%</text><text class="shadow" x="125.5" y="15">Branches 41.6%</text><text class="high" x="125" y="14">Branches 41.6%</text><text class="shadow" x="227.5" y="15">Lines 53.61%</text><text class="high" x="227" y="14">Lines 53.61%</text><text class="shadow" x="314.5" y="15">Functions 60.18%</text><text class="high" x="314" y="14">Functions 60.18%</text></g></svg> <svg xmlns="http://www.w3.org/2000/svg" width="428" height="20"><defs><style>text{font-size:11px;font-family:Verdana,DejaVu Sans,Geneva,sans-serif}text.shadow{fill:#010101;fill-opacity:.3}text.high{fill:#fff}</style><linearGradient id="smooth" x2="0" y2="100%"><stop offset="0" stop-color="#aaa" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="round"><rect width="100%" height="100%" rx="3" fill="#fff"/></mask></defs><g id="bg" mask="url(#round)"><path fill="green" stroke="#000" d="M0 0h120v20H0zM120 0h109v20H120zM229 0h87v20h-87zM316 0h112v20H316z"/><path fill="url(#smooth)" d="M0 0h428v20H0z"/></g><g id="fg"><text class="shadow" x="5.5" y="15">Statements 52.81%</text><text class="high" x="5" y="14">Statements 52.81%</text><text class="shadow" x="125.5" y="15">Branches 41.64%</text><text class="high" x="125" y="14">Branches 41.64%</text><text class="shadow" x="234.5" y="15">Lines 53.62%</text><text class="high" x="234" y="14">Lines 53.62%</text><text class="shadow" x="321.5" y="15">Functions 60.18%</text><text class="high" x="321" y="14">Functions 60.18%</text></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="97" height="20"><defs><style>text{font-size:11px;font-family:Verdana,DejaVu Sans,Geneva,sans-serif}text.shadow{fill:#010101;fill-opacity:.3}text.high{fill:#fff}</style><linearGradient id="smooth" x2="0" y2="100%"><stop offset="0" stop-color="#aaa" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="round"><rect width="100%" height="100%" rx="3" fill="#fff"/></mask></defs><g id="bg" mask="url(#round)"><path fill="#696969" d="M0 0h41v20H0z"/><path fill="#4c1" d="M41 0h56v20H41z"/><path fill="url(#smooth)" d="M0 0h97v20H0z"/></g><g id="fg"><text class="shadow" x="5.5" y="15">Tests</text><text class="high" x="5" y="14">Tests</text><text class="shadow" x="46.5" y="15">141/141</text><text class="high" x="46" y="14">141/141</text></g></svg> <svg xmlns="http://www.w3.org/2000/svg" width="97" height="20"><defs><style>text{font-size:11px;font-family:Verdana,DejaVu Sans,Geneva,sans-serif}text.shadow{fill:#010101;fill-opacity:.3}text.high{fill:#fff}</style><linearGradient id="smooth" x2="0" y2="100%"><stop offset="0" stop-color="#aaa" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="round"><rect width="100%" height="100%" rx="3" fill="#fff"/></mask></defs><g id="bg" mask="url(#round)"><path fill="#696969" d="M0 0h41v20H0z"/><path fill="#e05d44" d="M41 0h56v20H41z"/><path fill="url(#smooth)" d="M0 0h97v20H0z"/></g><g id="fg"><text class="shadow" x="5.5" y="15">Tests</text><text class="high" x="5" y="14">Tests</text><text class="shadow" x="46.5" y="15">140/141</text><text class="high" x="46" y="14">140/141</text></g></svg>

Before

Width:  |  Height:  |  Size: 820 B

After

Width:  |  Height:  |  Size: 823 B

View File

@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}

5900
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -136,73 +136,72 @@
"dependencies": { "dependencies": {
"@babel/polyfill": "7.12.1", "@babel/polyfill": "7.12.1",
"canvg": "3.0.7", "canvg": "3.0.7",
"core-js": "3.7.0", "core-js": "3.8.3",
"jspdf": "2.1.1", "jspdf": "2.3.0",
"pathseg": "1.2.0", "pathseg": "1.2.0",
"regenerator-runtime": "0.13.7", "regenerator-runtime": "0.13.7",
"svg2pdf.js": "2.0.0" "svg2pdf.js": "2.1.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "7.12.3", "@babel/core": "7.12.16",
"@babel/preset-env": "7.12.1", "@babel/preset-env": "7.12.16",
"@babel/register": "7.12.1", "@babel/register": "7.12.13",
"@babel/runtime-corejs3": "7.12.5", "@babel/runtime-corejs3": "7.12.13",
"@cypress/code-coverage": "3.8.3", "@cypress/code-coverage": "3.9.2",
"@cypress/fiddle": "1.18.4", "@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.1", "@rollup/plugin-babel": "5.3.0",
"@rollup/plugin-commonjs": "15.1.0", "@rollup/plugin-commonjs": "15.1.0",
"@rollup/plugin-dynamic-import-vars": "1.1.0", "@rollup/plugin-dynamic-import-vars": "1.1.1",
"@rollup/plugin-node-resolve": "9.0.0", "@rollup/plugin-node-resolve": "11.2.0",
"@rollup/plugin-replace": "2.3.4", "@rollup/plugin-replace": "2.3.4",
"@rollup/plugin-url": "5.0.1", "@rollup/plugin-url": "6.0.0",
"axe-core": "4.0.2", "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.0", "copyfiles": "2.4.1",
"core-js-bundle": "3.7.0", "core-js-bundle": "3.8.3",
"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": "5.5.0", "cypress": "6.4.0",
"cypress-axe": "0.10.0", "cypress-axe": "0.12.1",
"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",
"es-dev-commonjs-transformer": "0.2.0", "es-dev-commonjs-transformer": "0.2.0",
"es-dev-server": "1.57.8", "es-dev-server": "2.1.0",
"es-dev-server-rollup": "0.0.8", "es-dev-server-rollup": "0.0.8",
"eslint": "7.13.0", "eslint": "^7.20.0",
"eslint-config-ash-nazg": "22.10.0", "eslint-config-standard": "16.0.2",
"eslint-config-standard": "16.0.1",
"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.8.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.0", "eslint-plugin-html": "^6.1.1",
"eslint-plugin-import": "2.22.1", "eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsdoc": "30.7.7", "eslint-plugin-jsdoc": "^31.6.1",
"eslint-plugin-markdown": "1.0.2", "eslint-plugin-markdown": "^2.0.0-rc.2",
"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.5.0",
"eslint-plugin-standard": "4.0.2", "eslint-plugin-standard": "4.1.0",
"eslint-plugin-unicorn": "23.0.0", "eslint-plugin-unicorn": "28.0.0",
"husky": "4.3.0", "husky": "5.0.9",
"imageoptim-cli": "3.0.2", "imageoptim-cli": "3.0.2",
"jamilih": "0.53.2", "jamilih": "0.53.2",
"jsdoc": "3.6.6", "jsdoc": "3.6.6",
"license-badger": "0.18.0", "license-badger": "0.18.0",
"lint-staged": "10.5.1", "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.1",
"mochawesome-merge": "4.2.0", "mochawesome-merge": "4.2.0",
@@ -218,16 +217,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.33.1", "rollup": "2.39.0",
"rollup-plugin-copy": "3.3.0", "rollup-plugin-copy": "3.3.0",
"rollup-plugin-filesize": "9.0.2", "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.4.0",
"systemjs": "6.7.1", "systemjs": "6.8.3",
"typescript": "4.0.5", "typescript": "4.1.5",
"underscore": "1.11.0" "underscore": "1.12.0"
} }
} }

View File

@@ -111,8 +111,10 @@ 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
console.log(data)
} }
}); });

View File

@@ -2753,12 +2753,10 @@ editor.init = () => {
* @returns {external:jQuery} * @returns {external:jQuery}
*/ */
const makeFlyoutHolder = function (id, child) { const makeFlyoutHolder = function (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

@@ -165,7 +165,6 @@ export const convertPath = function (pth, toRel) {
} }
d += pathDSegment(letter, [[x1, y1], [x, y]]); d += pathDSegment(letter, [[x1, y1], [x, y]]);
break; break;
// eslint-disable-next-line sonarjs/no-duplicated-branches
case 10: // absolute elliptical arc (A) case 10: // absolute elliptical arc (A)
x -= curx; x -= curx;
y -= cury; y -= cury;

View File

@@ -77,7 +77,7 @@ export const setLinkControlPoints = function (lcp) {
* @type {null|module:path.Path} * @type {null|module:path.Path}
* @memberof module:path * @memberof module:path
*/ */
export let path = null; // eslint-disable-line import/no-mutable-exports export let path = null;
let editorContext_ = null; let editorContext_ = null;

View File

@@ -2701,7 +2701,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,
@@ -2731,7 +2731,6 @@ class SvgCanvas {
transformPoint, transformPoint,
walkTree walkTree
}; };
return obj;
}; };
} // End constructor } // End constructor
} // End class } // End class

View File

@@ -4,9 +4,6 @@
// Todo: Show /test (i.e., `unit.js`) test results at beginning? // Todo: Show /test (i.e., `unit.js`) test results at beginning?
// See https://github.com/jsdoc/jsdoc/issues/1750 to create such tags
/* eslint "jsdoc/check-tag-names": ["error", {definedTags: ["cli-arg"]}] --
we want a custom tag */
/** /**
* @file A CLI reporter against after-the-fact compiled (merged Mochawesome) * @file A CLI reporter against after-the-fact compiled (merged Mochawesome)
* Mocha results. * Mocha results.
@@ -23,7 +20,6 @@ const reporterFile = process.argv[2]
const path = '../mochawesome.json'; const path = '../mochawesome.json';
// eslint-disable-next-line import/no-dynamic-require -- Allow CLI to change
const MochaReporter = require(`mocha/lib/reporters/${reporterFile}.js`); const MochaReporter = require(`mocha/lib/reporters/${reporterFile}.js`);
const Suite = require('mocha/lib/suite.js'); const Suite = require('mocha/lib/suite.js');
const Test = require('mocha/lib/test.js'); const Test = require('mocha/lib/test.js');
@@ -39,8 +35,6 @@ const {constants: {
EVENT_TEST_PENDING EVENT_TEST_PENDING
}} = require('mocha/lib/runner.js'); }} = require('mocha/lib/runner.js');
// eslint-disable-next-line max-len -- Won't let us make next line multiline
// eslint-disable-next-line import/no-dynamic-require -- Not fixed now, but may allow changing
const {results, stats} = require(path); const {results, stats} = require(path);
const runner = new Runner( const runner = new Runner(