Linter: apply all recommended biome settings

Enforces previously-skipped useArrowFunction check
This commit is contained in:
Lovell Fuller
2025-11-03 21:14:45 +00:00
parent 09d5aa8cfa
commit 4f9f8179a6
66 changed files with 1823 additions and 1910 deletions

View File

@@ -9,12 +9,12 @@ const assert = require('node:assert');
const sharp = require('../../');
const fixtures = require('../fixtures');
describe('Sharpen', function () {
it('specific radius 10 (sigma 6)', function (_t, done) {
describe('Sharpen', () => {
it('specific radius 10 (sigma 6)', (_t, done) => {
sharp(fixtures.inputJpg)
.resize(320, 240)
.sharpen(6)
.toBuffer(function (err, data, info) {
.toBuffer((err, data, info) => {
if (err) throw err;
assert.strictEqual('jpeg', info.format);
assert.strictEqual(320, info.width);
@@ -23,11 +23,11 @@ describe('Sharpen', function () {
});
});
it('specific radius 3 (sigma 1.5) and levels 0.5, 2.5', function (_t, done) {
it('specific radius 3 (sigma 1.5) and levels 0.5, 2.5', (_t, done) => {
sharp(fixtures.inputJpg)
.resize(320, 240)
.sharpen(1.5, 0.5, 2.5)
.toBuffer(function (err, data, info) {
.toBuffer((err, data, info) => {
if (err) throw err;
assert.strictEqual('jpeg', info.format);
assert.strictEqual(320, info.width);
@@ -36,11 +36,11 @@ describe('Sharpen', function () {
});
});
it('specific radius 5 (sigma 3.5) and levels 2, 4', function (_t, done) {
it('specific radius 5 (sigma 3.5) and levels 2, 4', (_t, done) => {
sharp(fixtures.inputJpg)
.resize(320, 240)
.sharpen(3.5, 2, 4)
.toBuffer(function (err, data, info) {
.toBuffer((err, data, info) => {
if (err) throw err;
assert.strictEqual('jpeg', info.format);
assert.strictEqual(320, info.width);
@@ -66,11 +66,11 @@ describe('Sharpen', function () {
});
if (!process.env.SHARP_TEST_WITHOUT_CACHE) {
it('specific radius/levels with alpha channel', function (_t, done) {
it('specific radius/levels with alpha channel', (_t, done) => {
sharp(fixtures.inputPngWithTransparency)
.resize(320, 240)
.sharpen(5, 4, 8)
.toBuffer(function (err, data, info) {
.toBuffer((err, data, info) => {
if (err) throw err;
assert.strictEqual('png', info.format);
assert.strictEqual(4, info.channels);
@@ -81,11 +81,11 @@ describe('Sharpen', function () {
});
}
it('mild sharpen', function (_t, done) {
it('mild sharpen', (_t, done) => {
sharp(fixtures.inputJpg)
.resize(320, 240)
.sharpen()
.toBuffer(function (err, data, info) {
.toBuffer((err, data, info) => {
if (err) throw err;
assert.strictEqual('jpeg', info.format);
assert.strictEqual(320, info.width);
@@ -94,20 +94,20 @@ describe('Sharpen', function () {
});
});
it('invalid sigma', function () {
assert.throws(function () {
it('invalid sigma', () => {
assert.throws(() => {
sharp(fixtures.inputJpg).sharpen(-1.5);
});
});
it('invalid flat', function () {
assert.throws(function () {
it('invalid flat', () => {
assert.throws(() => {
sharp(fixtures.inputJpg).sharpen(1, -1);
});
});
it('invalid jagged', function () {
assert.throws(function () {
it('invalid jagged', () => {
assert.throws(() => {
sharp(fixtures.inputJpg).sharpen(1, 1, -1);
});
});
@@ -142,11 +142,11 @@ describe('Sharpen', function () {
/Expected number between 0 and 1000000 for options\.y3 but received -1 of type number/
));
it('sharpened image is larger than non-sharpened', function (_t, done) {
it('sharpened image is larger than non-sharpened', (_t, done) => {
sharp(fixtures.inputJpg)
.resize(320, 240)
.sharpen(false)
.toBuffer(function (err, notSharpened, info) {
.toBuffer((err, notSharpened, info) => {
if (err) throw err;
assert.strictEqual(true, notSharpened.length > 0);
assert.strictEqual('jpeg', info.format);
@@ -155,7 +155,7 @@ describe('Sharpen', function () {
sharp(fixtures.inputJpg)
.resize(320, 240)
.sharpen(true)
.toBuffer(function (err, sharpened, info) {
.toBuffer((err, sharpened, info) => {
if (err) throw err;
assert.strictEqual(true, sharpened.length > 0);
assert.strictEqual(true, sharpened.length > notSharpened.length);