dependencies update and fix lint unused disabled line

This commit is contained in:
JFH
2021-11-25 23:40:07 +01:00
parent 83303065bb
commit b09f71e703
60 changed files with 339 additions and 613 deletions

View File

@@ -5,7 +5,6 @@ import * as coords from '../../../instrumented/svgcanvas/coords.js';
describe('coords', function () {
let elemId = 1;
// eslint-disable-next-line no-shadow
const root = document.createElement('div');
root.id = 'root';
root.style.visibility = 'hidden';

View File

@@ -19,7 +19,6 @@ describe('draw.Drawing', function () {
const PATH_ATTR = {
// clone will convert relative to absolute, so the test for equality fails.
// d: 'm7.38867,57.38867c0,-27.62431 22.37569,-50 50,-50c27.62431,0 50,22.37569 50,50c0,27.62431 -22.37569,50 -50,50c-27.62431,0 -50,-22.37569 -50,-50z',
// eslint-disable-next-line max-len
d: 'M7.389,57.389C7.389,29.764 29.764,7.389 57.389,7.389C85.013,7.389 107.389,29.764 107.389,57.389C107.389,85.013 85.013,107.389 57.389,107.389C29.764,107.389 7.389,85.013 7.389,57.389z',
transform: 'rotate(45 57.388671875000036,57.388671874999986) ',
'stroke-width': '5',

View File

@@ -25,7 +25,7 @@ describe('history', function () {
unapply (handler) {
super.unapply(handler, () => { /* empty fn */ });
}
elements () { return []; } // eslint-disable-line class-methods-use-this
elements () { return []; }
}
/*

View File

@@ -48,7 +48,7 @@ describe('path', function () {
const [ mockPathContext, mockUtilitiesContext ] = getMockContexts();
pathModule.init(mockPathContext);
utilities.init(mockUtilitiesContext);
new Path(path); // eslint-disable-line no-new
new Path(path);
assert.equal(path.pathSegList.getItem(1).pathSegTypeAsLetter, 'L');
assert.equal(path.pathSegList.getItem(1).x, 10);
@@ -68,7 +68,7 @@ describe('path', function () {
const [ mockPathContext, mockUtilitiesContext ] = getMockContexts();
pathModule.init(mockPathContext);
utilities.init(mockUtilitiesContext);
new Path(path); // eslint-disable-line no-new
new Path(path);
assert.equal(path.pathSegList.getItem(1).pathSegTypeAsLetter, 'L');
assert.equal(path.pathSegList.getItem(1).x, 10);
@@ -124,7 +124,7 @@ describe('path', function () {
const [ mockPathContext, mockUtilitiesContext ] = getMockContexts();
pathModule.init(mockPathContext);
utilities.init(mockUtilitiesContext);
new Path(path); // eslint-disable-line no-new
new Path(path);
assert.equal(path.pathSegList.getItem(1).pathSegTypeAsLetter, 'L');
assert.equal(path.pathSegList.getItem(1).x, 10);
@@ -144,7 +144,7 @@ describe('path', function () {
const [ mockPathContext, mockUtilitiesContext ] = getMockContexts();
pathModule.init(mockPathContext);
utilities.init(mockUtilitiesContext);
new Path(path); // eslint-disable-line no-new
new Path(path);
assert.equal(path.pathSegList.getItem(1).pathSegTypeAsLetter, 'C');
assert.equal(path.pathSegList.getItem(1).x1, 11);

View File

@@ -5,7 +5,6 @@ import * as recalculate from '../../../instrumented/svgcanvas/recalculate.js';
describe('recalculate', function () {
// eslint-disable-next-line no-shadow
const root = document.createElement('div');
root.id = 'root';
root.style.visibility = 'hidden';

View File

@@ -1,4 +1,3 @@
/* eslint-disable max-len */
import 'pathseg';
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
@@ -174,7 +173,7 @@ describe('utilities bbox', function () {
const rect = { x: 10, y: 10, width: 10, height: 20 };
const angle = 45;
const origin = { x: 15, y: 20 }; // eslint-disable-line no-shadow
const origin = { x: 15, y: 20 };
elem = mockCreateSVGElement({
element: 'rect',
attr: { id: 'rect2', x: rect.x, y: rect.y, width: rect.width, height: rect.height, transform: 'rotate(' + angle + ' ' + origin.x + ',' + origin.y + ')' }
@@ -263,7 +262,7 @@ describe('utilities bbox', function () {
const rect = { x: 10, y: 10, width: 10, height: 20 };
const angle = 45;
const origin = { x: 15, y: 20 }; // eslint-disable-line no-shadow
const origin = { x: 15, y: 20 };
tx = 10; // tx right
ty = 10; // tx down
txInRotatedSpace = Math.sqrt(tx * tx + ty * ty); // translate in rotated 45 space.
@@ -466,7 +465,7 @@ describe('utilities bbox', function () {
* @param {module:math.XYObject} origin
* @returns {module:math.XYObject}
*/
function rotatePoint (point, angle, origin) { // eslint-disable-line no-shadow
function rotatePoint (point, angle, origin) {
if (!origin) {
origin = { x: 0, y: 0 };
}
@@ -485,7 +484,7 @@ describe('utilities bbox', function () {
* @param {module:math.XYObject} origin
* @returns {module:utilities.BBoxObject}
*/
function rotateRect (rect, angle, origin) { // eslint-disable-line no-shadow
function rotateRect (rect, angle, origin) {
const tl = rotatePoint({ x: rect.x, y: rect.y }, angle, origin);
const tr = rotatePoint({ x: rect.x + rect.width, y: rect.y }, angle, origin);
const br = rotatePoint({ x: rect.x + rect.width, y: rect.y + rect.height }, angle, origin);

View File

@@ -1,4 +1,3 @@
/* eslint-disable max-len */
import * as utilities from '../../../instrumented/svgcanvas/utilities.js';
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
@@ -29,7 +28,6 @@ describe('utilities', function () {
let mockHistorySubCommands = [];
const mockHistory = {
BatchCommand: class {
// eslint-disable-next-line class-methods-use-this
addSubCommand (cmd) {
mockHistorySubCommands.push(cmd);
}