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('Blur', function () {
it('specific radius 1', function (_t, done) {
describe('Blur', () => {
it('specific radius 1', (_t, done) => {
sharp(fixtures.inputJpg)
.resize(320, 240)
.blur(1)
.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('Blur', function () {
});
});
it('specific radius 10', function (_t, done) {
it('specific radius 10', (_t, done) => {
sharp(fixtures.inputJpg)
.resize(320, 240)
.blur(10)
.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('Blur', function () {
});
});
it('specific options.sigma 10', function (_t, done) {
it('specific options.sigma 10', (_t, done) => {
sharp(fixtures.inputJpg)
.resize(320, 240)
.blur({ sigma: 10 })
.toBuffer(function (err, data, info) {
.toBuffer((err, data, info) => {
if (err) throw err;
assert.strictEqual('jpeg', info.format);
assert.strictEqual(320, info.width);
@@ -49,11 +49,11 @@ describe('Blur', function () {
});
});
it('specific radius 0.3', function (_t, done) {
it('specific radius 0.3', (_t, done) => {
sharp(fixtures.inputJpg)
.resize(320, 240)
.blur(0.3)
.toBuffer(function (err, data, info) {
.toBuffer((err, data, info) => {
if (err) throw err;
assert.strictEqual('jpeg', info.format);
assert.strictEqual(320, info.width);
@@ -62,11 +62,11 @@ describe('Blur', function () {
});
});
it('mild blur', function (_t, done) {
it('mild blur', (_t, done) => {
sharp(fixtures.inputJpg)
.resize(320, 240)
.blur()
.toBuffer(function (err, data, info) {
.toBuffer((err, data, info) => {
if (err) throw err;
assert.strictEqual('jpeg', info.format);
assert.strictEqual(320, info.width);
@@ -75,17 +75,17 @@ describe('Blur', function () {
});
});
it('invalid radius', function () {
assert.throws(function () {
it('invalid radius', () => {
assert.throws(() => {
sharp(fixtures.inputJpg).blur(0.1);
});
});
it('blurred image is smaller than non-blurred', function (_t, done) {
it('blurred image is smaller than non-blurred', (_t, done) => {
sharp(fixtures.inputJpg)
.resize(320, 240)
.blur(false)
.toBuffer(function (err, notBlurred, info) {
.toBuffer((err, notBlurred, info) => {
if (err) throw err;
assert.strictEqual(true, notBlurred.length > 0);
assert.strictEqual('jpeg', info.format);
@@ -94,7 +94,7 @@ describe('Blur', function () {
sharp(fixtures.inputJpg)
.resize(320, 240)
.blur(true)
.toBuffer(function (err, blurred, info) {
.toBuffer((err, blurred, info) => {
if (err) throw err;
assert.strictEqual(true, blurred.length > 0);
assert.strictEqual(true, blurred.length < notBlurred.length);
@@ -106,18 +106,18 @@ describe('Blur', function () {
});
});
it('invalid precision', function () {
assert.throws(function () {
it('invalid precision', () => {
assert.throws(() => {
sharp(fixtures.inputJpg).blur({ sigma: 1, precision: 'invalid' });
}, /Expected one of: integer, float, approximate for precision but received invalid of type string/);
});
it('invalid minAmplitude', function () {
assert.throws(function () {
it('invalid minAmplitude', () => {
assert.throws(() => {
sharp(fixtures.inputJpg).blur({ sigma: 1, minAmplitude: 0 });
}, /Expected number between 0.001 and 1 for minAmplitude but received 0 of type number/);
assert.throws(function () {
assert.throws(() => {
sharp(fixtures.inputJpg).blur({ sigma: 1, minAmplitude: 1.01 });
}, /Expected number between 0.001 and 1 for minAmplitude but received 1.01 of type number/);
});
@@ -150,8 +150,8 @@ describe('Blur', function () {
await fixtures.assertSimilar(fixtures.expected('blur-10.jpg'), minAmplitudeLow);
});
it('options.sigma is required if options object is passed', function () {
assert.throws(function () {
it('options.sigma is required if options object is passed', () => {
assert.throws(() => {
sharp(fixtures.inputJpg).blur({ precision: 'invalid' });
}, /Expected number between 0.3 and 1000 for options.sigma but received undefined of type undefined/);
});