mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Switch linter from semistandard to biome
Uses the recommended rules apart from complexity/useArrowFunction, which would affect about 1700 lines of code with little benefit right now. This is something that can be addressed over time.
This commit is contained in:
10
test/fixtures/index.js
vendored
10
test/fixtures/index.js
vendored
@@ -1,9 +1,7 @@
|
||||
// Copyright 2013 Lovell Fuller and others.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const path = require('node:path');
|
||||
const sharp = require('../../');
|
||||
const maxColourDistance = require('../../lib/sharp')._maxColourDistance;
|
||||
|
||||
@@ -196,10 +194,10 @@ module.exports = {
|
||||
|
||||
assertMaxColourDistance: function (actualImagePath, expectedImagePath, acceptedDistance) {
|
||||
if (typeof actualImagePath !== 'string') {
|
||||
throw new TypeError('`actualImagePath` must be a string; got ' + actualImagePath);
|
||||
throw new TypeError(`\`actualImagePath\` must be a string; got ${actualImagePath}`);
|
||||
}
|
||||
if (typeof expectedImagePath !== 'string') {
|
||||
throw new TypeError('`expectedImagePath` must be a string; got ' + expectedImagePath);
|
||||
throw new TypeError(`\`expectedImagePath\` must be a string; got ${expectedImagePath}`);
|
||||
}
|
||||
if (typeof acceptedDistance !== 'number') {
|
||||
// Default threshold
|
||||
@@ -207,7 +205,7 @@ module.exports = {
|
||||
}
|
||||
const distance = maxColourDistance(actualImagePath, expectedImagePath);
|
||||
if (distance > acceptedDistance) {
|
||||
throw new Error('Expected maximum absolute distance of ' + acceptedDistance + ', actual ' + distance);
|
||||
throw new Error(`Expected maximum absolute distance of ${acceptedDistance}, actual ${distance}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user