From b5357d3b11fb9421b8495e19c87617ef7ade222e Mon Sep 17 00:00:00 2001 From: strarsis Date: Wed, 30 Oct 2019 19:27:05 +0100 Subject: [PATCH] Fix lint errors. --- lib/svgo.js | 2 +- test/coa/_index.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/svgo.js b/lib/svgo.js index 6af85ae79..9ed8db37f 100644 --- a/lib/svgo.js +++ b/lib/svgo.js @@ -38,7 +38,7 @@ SVGO.prototype.optimize = function(svgstr, info) { return; } - if (info.multipassCount = ++counter < maxPassCount && svgjs.data.length < prevResultSize) { + if ((info.multipassCount = ++counter) < maxPassCount && svgjs.data.length < prevResultSize) { prevResultSize = svgjs.data.length; this._optimizeOnce(svgjs.data, info, optimizeOnceCallback); } else { diff --git a/test/coa/_index.js b/test/coa/_index.js index 7935be0fb..b6ac707c8 100644 --- a/test/coa/_index.js +++ b/test/coa/_index.js @@ -179,7 +179,7 @@ describe('coa', function() { }).then(function() { const svgOut = fs.readFileSync('temp.svg', 'utf8'); - done(/in_svg__/.test(svgOut) ? null : "filename isn't passed to prefixIds plugin."); + done(/in_svg__/.test(svgOut) ? null : 'filename isn\'t passed to prefixIds plugin.'); fse.removeSync('temp.svg'); }, error => done(error)); }); @@ -195,7 +195,7 @@ describe('coa', function() { }).then(function() { const mpSvgOut = fs.readFileSync('temp.svg', 'utf8'); - done(mpSvgOut === mpSvgExp ? null : "Multipass wasn't properly used."); + done(mpSvgOut === mpSvgExp ? null : 'Multipass wasn\'t properly used.'); fse.removeSync('temp.svg'); }, error => done(error)); }); @@ -211,7 +211,7 @@ describe('coa', function() { }).then(function() { const mpSvgOut = fs.readFileSync('temp.svg', 'utf8'); - done(!/in_svg__in_svg__/.test(mpSvgOut) ? null : "prefixIds plugin doesn't detect subsequent passes with multipass enabled."); + done(!/in_svg__in_svg__/.test(mpSvgOut) ? null : 'prefixIds plugin doesn\'t detect subsequent passes with multipass enabled.'); // https://github.com/svg/svgo/issues/659 // https://github.com/svg/svgo/issues/1133 @@ -233,7 +233,7 @@ describe('coa', function() { }).then(function() { const mpSvgOut = fs.readFileSync('temp.svg', 'utf8'); - done(!/aria-hidden="true" aria-hidden='true'/.test(mpSvgOut) ? null : "addAttributesToSVGElement plugin doesn't correctly handle subsequent passes with multipass enabled."); + done(!/aria-hidden="true" aria-hidden='true'/.test(mpSvgOut) ? null : 'addAttributesToSVGElement plugin doesn\'t correctly handle subsequent passes with multipass enabled.'); // https://github.com/svg/svgo/issues/659 // https://github.com/svg/svgo/issues/1133