- Linting (ESLint): Apply latest ash-nazg (with latest unicorn)

- npm: Update devDeps
master
Brett Zamir 2019-12-23 09:16:16 +08:00
parent 5f9085be1b
commit 31a98c1408
21 changed files with 711 additions and 372 deletions

View File

@ -120,7 +120,8 @@
viableNextSibling = viableNextSibling.nextSibling; viableNextSibling = viableNextSibling.nextSibling;
} }
var node = convertNodesIntoANode(nodes); var node = convertNodesIntoANode(nodes); // eslint-disable-next-line unicorn/prefer-modern-dom-apis
parent.insertBefore(node, viableNextSibling); parent.insertBefore(node, viableNextSibling);
}, },
replaceWith: function replaceWith() { replaceWith: function replaceWith() {
@ -141,6 +142,7 @@
if (this.parentNode === parent) { if (this.parentNode === parent) {
parent.replaceChild(node, this); parent.replaceChild(node, this);
} else { } else {
// eslint-disable-next-line unicorn/prefer-modern-dom-apis
parent.insertBefore(node, viableNextSibling); parent.insertBefore(node, viableNextSibling);
} }
}, },

View File

@ -365,7 +365,6 @@ var svgEditorExtension_imagelib = (function () {
return $.process_cancel(message); return $.process_cancel(message);
case 39: case 39:
// eslint-disable-next-line require-atomic-updates
transferStopped = true; // Should a message be sent back to the frame? transferStopped = true; // Should a message be sent back to the frame?
$('#dialog_box').hide(); $('#dialog_box').hide();

View File

@ -355,7 +355,6 @@ var svgEditorExtension_storage = (function () {
// doesn't even want to remember their not wanting // doesn't even want to remember their not wanting
// storage, so we don't set the cookie or continue on with // storage, so we don't set the cookie or continue on with
// setting storage on beforeunload // setting storage on beforeunload
// eslint-disable-next-line require-atomic-updates
document.cookie = 'svgeditstore=' + encodeURIComponent(pref) + '; expires=Fri, 31 Dec 9999 23:59:59 GMT'; // 'prefsAndContent' | 'prefsOnly' document.cookie = 'svgeditstore=' + encodeURIComponent(pref) + '; expires=Fri, 31 Dec 9999 23:59:59 GMT'; // 'prefsAndContent' | 'prefsOnly'
// If the URL was configured to always insist on a prompt, if // If the URL was configured to always insist on a prompt, if
// the user does indicate a wish to store their info, we // the user does indicate a wish to store their info, we

15
dist/index-es.js vendored
View File

@ -14771,8 +14771,7 @@ function SvgCanvas(container, config) {
if (extObj) { if (extObj) {
extObj.name = name; extObj.name = name;
} // eslint-disable-next-line require-atomic-updates }
extensions[name] = extObj; extensions[name] = extObj;
return _context.abrupt("return", call('extension_added', extObj)); return _context.abrupt("return", call('extension_added', extObj));
@ -21120,7 +21119,7 @@ function SvgCanvas(container, config) {
continue; continue;
} }
children[i++] = elem = parent.insertBefore(elem, anchor); children[i++] = elem = anchor.before(elem);
batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent)); batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent));
} // remove the group from the selection } // remove the group from the selection
@ -34347,22 +34346,17 @@ editor.init = function () {
case 11: case 11:
// set icon size // set icon size
setIconSize($$b('#iconsize').val()); setIconSize($$b('#iconsize').val()); // set grid setting
/* eslint-disable require-atomic-updates */
// set grid setting
curConfig.gridSnapping = $$b('#grid_snapping_on')[0].checked; curConfig.gridSnapping = $$b('#grid_snapping_on')[0].checked;
curConfig.snappingStep = $$b('#grid_snapping_step').val(); curConfig.snappingStep = $$b('#grid_snapping_step').val();
curConfig.gridColor = $$b('#grid_color').val(); curConfig.gridColor = $$b('#grid_color').val();
curConfig.showRulers = $$b('#show_rulers')[0].checked; curConfig.showRulers = $$b('#show_rulers')[0].checked;
/* eslint-enable require-atomic-updates */
$$b('#rulers').toggle(curConfig.showRulers); $$b('#rulers').toggle(curConfig.showRulers);
if (curConfig.showRulers) { if (curConfig.showRulers) {
updateRulers(); updateRulers();
} // eslint-disable-next-line require-atomic-updates }
curConfig.baseUnit = $$b('#base_unit').val(); curConfig.baseUnit = $$b('#base_unit').val();
svgCanvas.setConfig(curConfig); svgCanvas.setConfig(curConfig);
@ -36391,7 +36385,6 @@ editor.init = function () {
})); }));
case 15: case 15:
// eslint-disable-next-line require-atomic-updates
extsPreLang.length = 0; extsPreLang.length = 0;
_context17.next = 19; _context17.next = 19;
break; break;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

15
dist/index-umd.js vendored
View File

@ -14777,8 +14777,7 @@
if (extObj) { if (extObj) {
extObj.name = name; extObj.name = name;
} // eslint-disable-next-line require-atomic-updates }
extensions[name] = extObj; extensions[name] = extObj;
return _context.abrupt("return", call('extension_added', extObj)); return _context.abrupt("return", call('extension_added', extObj));
@ -21126,7 +21125,7 @@
continue; continue;
} }
children[i++] = elem = parent.insertBefore(elem, anchor); children[i++] = elem = anchor.before(elem);
batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent)); batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent));
} // remove the group from the selection } // remove the group from the selection
@ -34353,22 +34352,17 @@
case 11: case 11:
// set icon size // set icon size
setIconSize($$b('#iconsize').val()); setIconSize($$b('#iconsize').val()); // set grid setting
/* eslint-disable require-atomic-updates */
// set grid setting
curConfig.gridSnapping = $$b('#grid_snapping_on')[0].checked; curConfig.gridSnapping = $$b('#grid_snapping_on')[0].checked;
curConfig.snappingStep = $$b('#grid_snapping_step').val(); curConfig.snappingStep = $$b('#grid_snapping_step').val();
curConfig.gridColor = $$b('#grid_color').val(); curConfig.gridColor = $$b('#grid_color').val();
curConfig.showRulers = $$b('#show_rulers')[0].checked; curConfig.showRulers = $$b('#show_rulers')[0].checked;
/* eslint-enable require-atomic-updates */
$$b('#rulers').toggle(curConfig.showRulers); $$b('#rulers').toggle(curConfig.showRulers);
if (curConfig.showRulers) { if (curConfig.showRulers) {
updateRulers(); updateRulers();
} // eslint-disable-next-line require-atomic-updates }
curConfig.baseUnit = $$b('#base_unit').val(); curConfig.baseUnit = $$b('#base_unit').val();
svgCanvas.setConfig(curConfig); svgCanvas.setConfig(curConfig);
@ -36397,7 +36391,6 @@
})); }));
case 15: case 15:
// eslint-disable-next-line require-atomic-updates
extsPreLang.length = 0; extsPreLang.length = 0;
_context17.next = 19; _context17.next = 19;
break; break;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -14549,8 +14549,7 @@ var SvgCanvas = (function () {
if (extObj) { if (extObj) {
extObj.name = name; extObj.name = name;
} // eslint-disable-next-line require-atomic-updates }
extensions[name] = extObj; extensions[name] = extObj;
return _context.abrupt("return", call('extension_added', extObj)); return _context.abrupt("return", call('extension_added', extObj));
@ -20898,7 +20897,7 @@ var SvgCanvas = (function () {
continue; continue;
} }
children[i++] = elem = parent.insertBefore(elem, anchor); children[i++] = elem = anchor.before(elem);
batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent)); batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent));
} // remove the group from the selection } // remove the group from the selection

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -150,7 +150,6 @@ export default {
if (mode !== 'm') { if (mode !== 'm') {
await $.process_cancel(message); await $.process_cancel(message);
// eslint-disable-next-line require-atomic-updates
transferStopped = true; transferStopped = true;
// Should a message be sent back to the frame? // Should a message be sent back to the frame?

View File

@ -247,7 +247,6 @@ export default {
// doesn't even want to remember their not wanting // doesn't even want to remember their not wanting
// storage, so we don't set the cookie or continue on with // storage, so we don't set the cookie or continue on with
// setting storage on beforeunload // setting storage on beforeunload
// eslint-disable-next-line require-atomic-updates
document.cookie = 'svgeditstore=' + encodeURIComponent(pref) + '; expires=Fri, 31 Dec 9999 23:59:59 GMT'; // 'prefsAndContent' | 'prefsOnly' document.cookie = 'svgeditstore=' + encodeURIComponent(pref) + '; expires=Fri, 31 Dec 9999 23:59:59 GMT'; // 'prefsAndContent' | 'prefsOnly'
// If the URL was configured to always insist on a prompt, if // If the URL was configured to always insist on a prompt, if
// the user does indicate a wish to store their info, we // the user does indicate a wish to store their info, we

View File

@ -89,6 +89,7 @@ const ChildNode = {
viableNextSibling = viableNextSibling.nextSibling; viableNextSibling = viableNextSibling.nextSibling;
} }
const node = convertNodesIntoANode(nodes); const node = convertNodesIntoANode(nodes);
// eslint-disable-next-line unicorn/prefer-modern-dom-apis
parent.insertBefore(node, viableNextSibling); parent.insertBefore(node, viableNextSibling);
}, },
replaceWith (...nodes) { replaceWith (...nodes) {
@ -103,6 +104,7 @@ const ChildNode = {
if (this.parentNode === parent) { if (this.parentNode === parent) {
parent.replaceChild(node, this); parent.replaceChild(node, this);
} else { } else {
// eslint-disable-next-line unicorn/prefer-modern-dom-apis
parent.insertBefore(node, viableNextSibling); parent.insertBefore(node, viableNextSibling);
} }
}, },

View File

@ -4845,17 +4845,14 @@ editor.init = function () {
// set icon size // set icon size
setIconSize($('#iconsize').val()); setIconSize($('#iconsize').val());
/* eslint-disable require-atomic-updates */
// set grid setting // set grid setting
curConfig.gridSnapping = $('#grid_snapping_on')[0].checked; curConfig.gridSnapping = $('#grid_snapping_on')[0].checked;
curConfig.snappingStep = $('#grid_snapping_step').val(); curConfig.snappingStep = $('#grid_snapping_step').val();
curConfig.gridColor = $('#grid_color').val(); curConfig.gridColor = $('#grid_color').val();
curConfig.showRulers = $('#show_rulers')[0].checked; curConfig.showRulers = $('#show_rulers')[0].checked;
/* eslint-enable require-atomic-updates */
$('#rulers').toggle(curConfig.showRulers); $('#rulers').toggle(curConfig.showRulers);
if (curConfig.showRulers) { updateRulers(); } if (curConfig.showRulers) { updateRulers(); }
// eslint-disable-next-line require-atomic-updates
curConfig.baseUnit = $('#base_unit').val(); curConfig.baseUnit = $('#base_unit').val();
svgCanvas.setConfig(curConfig); svgCanvas.setConfig(curConfig);
@ -6270,7 +6267,6 @@ editor.init = function () {
importLocale: getImportLocale({defaultLang: lang, defaultName: ext.name}) importLocale: getImportLocale({defaultLang: lang, defaultName: ext.name})
}); });
})); }));
// eslint-disable-next-line require-atomic-updates
extsPreLang.length = 0; extsPreLang.length = 0;
} else { } else {
loadedExtensionNames.forEach((loadedExtensionName) => { loadedExtensionNames.forEach((loadedExtensionName) => {

View File

@ -1186,7 +1186,6 @@ this.addExtension = async function (name, extInitFunc, {$: jq, importLocale}) {
extObj.name = name; extObj.name = name;
} }
// eslint-disable-next-line require-atomic-updates
extensions[name] = extObj; extensions[name] = extObj;
return call('extension_added', extObj); return call('extension_added', extObj);
}; };
@ -3976,7 +3975,6 @@ this.rasterExport = async function (imgType, quality, exportWindowName, opts = {
const svg = this.svgCanvasToString(); const svg = this.svgCanvasToString();
if (!canvg) { if (!canvg) {
// eslint-disable-next-line require-atomic-updates
({canvg} = await importSetGlobal(curConfig.canvgPath + 'canvg.js', { ({canvg} = await importSetGlobal(curConfig.canvgPath + 'canvg.js', {
global: 'canvg' global: 'canvg'
})); }));
@ -6757,7 +6755,7 @@ this.ungroupSelectedElement = function () {
continue; continue;
} }
children[i++] = elem = parent.insertBefore(elem, anchor); children[i++] = elem = anchor.before(elem);
batchCmd.addSubCommand(new MoveElementCommand(elem, oldNextSibling, oldParent)); batchCmd.addSubCommand(new MoveElementCommand(elem, oldNextSibling, oldParent));
} }

View File

@ -14774,8 +14774,7 @@
if (extObj) { if (extObj) {
extObj.name = name; extObj.name = name;
} // eslint-disable-next-line require-atomic-updates }
extensions[name] = extObj; extensions[name] = extObj;
return _context.abrupt("return", call('extension_added', extObj)); return _context.abrupt("return", call('extension_added', extObj));
@ -21123,7 +21122,7 @@
continue; continue;
} }
children[i++] = elem = parent.insertBefore(elem, anchor); children[i++] = elem = anchor.before(elem);
batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent)); batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent));
} // remove the group from the selection } // remove the group from the selection
@ -34350,22 +34349,17 @@
case 11: case 11:
// set icon size // set icon size
setIconSize($$b('#iconsize').val()); setIconSize($$b('#iconsize').val()); // set grid setting
/* eslint-disable require-atomic-updates */
// set grid setting
curConfig.gridSnapping = $$b('#grid_snapping_on')[0].checked; curConfig.gridSnapping = $$b('#grid_snapping_on')[0].checked;
curConfig.snappingStep = $$b('#grid_snapping_step').val(); curConfig.snappingStep = $$b('#grid_snapping_step').val();
curConfig.gridColor = $$b('#grid_color').val(); curConfig.gridColor = $$b('#grid_color').val();
curConfig.showRulers = $$b('#show_rulers')[0].checked; curConfig.showRulers = $$b('#show_rulers')[0].checked;
/* eslint-enable require-atomic-updates */
$$b('#rulers').toggle(curConfig.showRulers); $$b('#rulers').toggle(curConfig.showRulers);
if (curConfig.showRulers) { if (curConfig.showRulers) {
updateRulers(); updateRulers();
} // eslint-disable-next-line require-atomic-updates }
curConfig.baseUnit = $$b('#base_unit').val(); curConfig.baseUnit = $$b('#base_unit').val();
svgCanvas.setConfig(curConfig); svgCanvas.setConfig(curConfig);
@ -36394,7 +36388,6 @@
})); }));
case 15: case 15:
// eslint-disable-next-line require-atomic-updates
extsPreLang.length = 0; extsPreLang.length = 0;
_context17.next = 19; _context17.next = 19;
break; break;

976
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -125,8 +125,8 @@
"coveradge": "^0.1.0", "coveradge": "^0.1.0",
"cypress": "^3.8.0", "cypress": "^3.8.0",
"cypress-axe": "^0.5.3", "cypress-axe": "^0.5.3",
"eslint": "^6.7.2", "eslint": "^6.8.0",
"eslint-config-ash-nazg": "^14.0.3", "eslint-config-ash-nazg": "^15.0.0",
"eslint-config-standard": "^14.1.0", "eslint-config-standard": "^14.1.0",
"eslint-plugin-array-func": "^3.1.3", "eslint-plugin-array-func": "^3.1.3",
"eslint-plugin-compat": "^3.3.0", "eslint-plugin-compat": "^3.3.0",
@ -142,7 +142,7 @@
"eslint-plugin-promise": "^4.2.1", "eslint-plugin-promise": "^4.2.1",
"eslint-plugin-sonarjs": "^0.5.0", "eslint-plugin-sonarjs": "^0.5.0",
"eslint-plugin-standard": "^4.0.1", "eslint-plugin-standard": "^4.0.1",
"eslint-plugin-unicorn": "^14.0.1", "eslint-plugin-unicorn": "^15.0.0",
"frs-replace": "^2.0.1", "frs-replace": "^2.0.1",
"gh-badges": "^2.2.1", "gh-badges": "^2.2.1",
"imageoptim-cli": "^3.0.2", "imageoptim-cli": "^3.0.2",
@ -151,7 +151,7 @@
"load-stylesheets": "^0.9.0", "load-stylesheets": "^0.9.0",
"node-static": "^0.7.11", "node-static": "^0.7.11",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"nyc": "^14.1.1", "nyc": "^15.0.0",
"open-cli": "^5.0.0", "open-cli": "^5.0.0",
"promise-fs": "^2.1.1", "promise-fs": "^2.1.1",
"qr-manipulation": "https://github.com/brettz9/qr-manipulation", "qr-manipulation": "https://github.com/brettz9/qr-manipulation",
@ -159,11 +159,11 @@
"regenerator-runtime": "^0.13.3", "regenerator-runtime": "^0.13.3",
"remark-cli": "^7.0.1", "remark-cli": "^7.0.1",
"remark-lint-ordered-list-marker-value": "^1.0.4", "remark-lint-ordered-list-marker-value": "^1.0.4",
"rollup": "1.27.13", "rollup": "1.27.14",
"rollup-plugin-babel": "^4.3.3", "rollup-plugin-babel": "^4.3.3",
"rollup-plugin-re": "^1.0.7", "rollup-plugin-re": "^1.0.7",
"rollup-plugin-terser": "^5.1.3", "rollup-plugin-terser": "^5.1.3",
"stackblur-canvas": "^2.2.0", "stackblur-canvas": "^2.2.0",
"typescript": "^3.7.3" "typescript": "^3.7.4"
} }
} }

View File

@ -14774,8 +14774,7 @@
if (extObj) { if (extObj) {
extObj.name = name; extObj.name = name;
} // eslint-disable-next-line require-atomic-updates }
extensions[name] = extObj; extensions[name] = extObj;
return _context.abrupt("return", call('extension_added', extObj)); return _context.abrupt("return", call('extension_added', extObj));
@ -21123,7 +21122,7 @@
continue; continue;
} }
children[i++] = elem = parent.insertBefore(elem, anchor); children[i++] = elem = anchor.before(elem);
batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent)); batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent));
} // remove the group from the selection } // remove the group from the selection
@ -34350,22 +34349,17 @@
case 11: case 11:
// set icon size // set icon size
setIconSize($$b('#iconsize').val()); setIconSize($$b('#iconsize').val()); // set grid setting
/* eslint-disable require-atomic-updates */
// set grid setting
curConfig.gridSnapping = $$b('#grid_snapping_on')[0].checked; curConfig.gridSnapping = $$b('#grid_snapping_on')[0].checked;
curConfig.snappingStep = $$b('#grid_snapping_step').val(); curConfig.snappingStep = $$b('#grid_snapping_step').val();
curConfig.gridColor = $$b('#grid_color').val(); curConfig.gridColor = $$b('#grid_color').val();
curConfig.showRulers = $$b('#show_rulers')[0].checked; curConfig.showRulers = $$b('#show_rulers')[0].checked;
/* eslint-enable require-atomic-updates */
$$b('#rulers').toggle(curConfig.showRulers); $$b('#rulers').toggle(curConfig.showRulers);
if (curConfig.showRulers) { if (curConfig.showRulers) {
updateRulers(); updateRulers();
} // eslint-disable-next-line require-atomic-updates }
curConfig.baseUnit = $$b('#base_unit').val(); curConfig.baseUnit = $$b('#base_unit').val();
svgCanvas.setConfig(curConfig); svgCanvas.setConfig(curConfig);
@ -36394,7 +36388,6 @@
})); }));
case 15: case 15:
// eslint-disable-next-line require-atomic-updates
extsPreLang.length = 0; extsPreLang.length = 0;
_context17.next = 19; _context17.next = 19;
break; break;