Skip to content

Commit

Permalink
Upgrade semistandard, appease new linter rules
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Sep 26, 2023
1 parent 854ed65 commit a41c62b
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 44 deletions.
28 changes: 14 additions & 14 deletions lib/is.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,18 @@ const invalidParameterError = function (name, expected, actual) {
};

module.exports = {
defined: defined,
object: object,
plainObject: plainObject,
fn: fn,
bool: bool,
buffer: buffer,
typedArray: typedArray,
arrayBuffer: arrayBuffer,
string: string,
number: number,
integer: integer,
inRange: inRange,
inArray: inArray,
invalidParameterError: invalidParameterError
defined,
object,
plainObject,
fn,
bool,
buffer,
typedArray,
arrayBuffer,
string,
number,
integer,
inRange,
inArray,
invalidParameterError
};
2 changes: 1 addition & 1 deletion lib/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ function _pipeline (callback) {
reject(err);
} else {
if (this.options.resolveWithObject) {
resolve({ data: data, info: info });
resolve({ data, info });
} else {
resolve(data);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"prebuild": "^12.1.0",
"semistandard": "^16.0.1",
"semistandard": "^17.0.0",
"tar-fs": "^3.0.4",
"tsd": "^0.29.0"
},
Expand Down
6 changes: 3 additions & 3 deletions test/bench/perf.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ async.series({
srcPath: fixtures.inputJpg,
dstPath: outputJpg,
quality: 0.8,
width: width,
height: height,
width,
height,
format: 'jpg',
filter: 'Lanczos'
}, function (err) {
Expand Down Expand Up @@ -795,7 +795,7 @@ async.series({
imagemagick.resize({
srcPath: fixtures.inputPngAlphaPremultiplicationLarge,
dstPath: outputPng,
width: width,
width,
height: heightPng,
filter: 'Lanczos',
customArgs: [
Expand Down
4 changes: 2 additions & 2 deletions test/unit/composite.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ describe('composite', () => {
.resize(80)
.composite([{
input: fixtures.inputPngWithTransparency16bit,
gravity: gravity
gravity
}])
.toBuffer((err, data, info) => {
if (err) throw err;
Expand Down Expand Up @@ -314,7 +314,7 @@ describe('composite', () => {
.composite([{
input: fixtures.inputPngWithTransparency16bit,
tile: true,
gravity: gravity
gravity
}])
.toBuffer((err, data, info) => {
if (err) throw err;
Expand Down
8 changes: 4 additions & 4 deletions test/unit/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('Extend', function () {
sharp(fixtures.inputWebPAnimated, { pages: -1 })
.resize(120)
.extend({
extendWith: extendWith,
extendWith,
top: 40,
bottom: 40,
left: 40,
Expand All @@ -58,7 +58,7 @@ describe('Extend', function () {
sharp(fixtures.inputJpg)
.resize(120)
.extend({
extendWith: extendWith,
extendWith,
top: 10,
bottom: 10,
left: 10,
Expand All @@ -77,7 +77,7 @@ describe('Extend', function () {
sharp(fixtures.inputPngWithTransparency16bit)
.resize(120)
.extend({
extendWith: extendWith,
extendWith,
top: 50,
left: 10,
right: 35,
Expand All @@ -94,7 +94,7 @@ describe('Extend', function () {
it(`PNG with 2 channels (${extendWith})`, function (done) {
sharp(fixtures.inputPngWithGreyAlpha)
.extend({
extendWith: extendWith,
extendWith,
top: 50,
bottom: 50,
left: 80,
Expand Down
8 changes: 4 additions & 4 deletions test/unit/io.js
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ describe('Input/output', function () {
channels: 3,
background: { r: 0, g: 255, b: 0 }
};
sharp({ create: create })
sharp({ create })
.jpeg()
.toBuffer(function (err, data, info) {
if (err) throw err;
Expand All @@ -932,7 +932,7 @@ describe('Input/output', function () {
channels: 4,
background: { r: 255, g: 0, b: 0, alpha: 128 }
};
sharp({ create: create })
sharp({ create })
.png()
.toBuffer(function (err, data, info) {
if (err) throw err;
Expand All @@ -951,7 +951,7 @@ describe('Input/output', function () {
background: { r: 0, g: 0, b: 0 }
};
assert.throws(function () {
sharp({ create: create });
sharp({ create });
});
});
it('Missing background', function () {
Expand All @@ -961,7 +961,7 @@ describe('Input/output', function () {
channels: 3
};
assert.throws(function () {
sharp({ create: create });
sharp({ create });
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/unit/jpeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('JPEG', function () {
[-1, 88.2, 'test'].forEach(function (quality) {
it(quality.toString(), function () {
assert.throws(function () {
sharp().jpeg({ quality: quality });
sharp().jpeg({ quality });
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/unit/resize.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ describe('Resize dimensions', function () {
].forEach(function (kernel) {
it(`kernel ${kernel}`, function (done) {
sharp(fixtures.inputJpg)
.resize(320, null, { kernel: kernel })
.resize(320, null, { kernel })
.toBuffer(function (err, data, info) {
if (err) throw err;
assert.strictEqual('jpeg', info.format);
Expand Down
6 changes: 3 additions & 3 deletions test/unit/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('Text to image', function () {
const text = sharp({
text: {
text: 'Hello, world!',
dpi: dpi
dpi
}
});
text.toFile(output, function (err, info) {
Expand All @@ -87,7 +87,7 @@ describe('Text to image', function () {
text: {
text: '<span foreground="red" font="100">red</span><span font="50" background="cyan">blue</span>',
rgba: true,
dpi: dpi
dpi
}
});
text.toFile(output, function (err, info) {
Expand Down Expand Up @@ -146,7 +146,7 @@ describe('Text to image', function () {
text: {
text: '<span background="cyan">cool</span>',
font: 'sans 30',
dpi: dpi,
dpi,
rgba: true
}
},
Expand Down
20 changes: 10 additions & 10 deletions test/unit/tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('Tile', function () {
[1, 8192].forEach(function (size) {
assert.doesNotThrow(function () {
sharp().tile({
size: size
size
});
});
});
Expand All @@ -135,7 +135,7 @@ describe('Tile', function () {
['zoinks', 1.1, -1, 0, 8193].forEach(function (size) {
assert.throws(function () {
sharp().tile({
size: size
size
});
});
});
Expand All @@ -146,7 +146,7 @@ describe('Tile', function () {
assert.doesNotThrow(function () {
sharp().tile({
size: 8192,
overlap: overlap
overlap
});
});
});
Expand All @@ -156,7 +156,7 @@ describe('Tile', function () {
['zoinks', 1.1, -1, 8193].forEach(function (overlap) {
assert.throws(function () {
sharp().tile({
overlap: overlap
overlap
});
});
});
Expand All @@ -166,7 +166,7 @@ describe('Tile', function () {
['fs', 'zip'].forEach(function (container) {
assert.doesNotThrow(function () {
sharp().tile({
container: container
container
});
});
});
Expand All @@ -176,7 +176,7 @@ describe('Tile', function () {
['zoinks', 1].forEach(function (container) {
assert.throws(function () {
sharp().tile({
container: container
container
});
});
});
Expand All @@ -186,7 +186,7 @@ describe('Tile', function () {
['dz', 'google', 'zoomify'].forEach(function (layout) {
assert.doesNotThrow(function () {
sharp().tile({
layout: layout
layout
});
});
});
Expand All @@ -196,7 +196,7 @@ describe('Tile', function () {
['zoinks', 1].forEach(function (layout) {
assert.throws(function () {
sharp().tile({
layout: layout
layout
});
});
});
Expand Down Expand Up @@ -254,7 +254,7 @@ describe('Tile', function () {
[90, 270, -90].forEach(function (angle) {
assert.doesNotThrow(function () {
sharp().tile({
angle: angle
angle
});
});
});
Expand All @@ -264,7 +264,7 @@ describe('Tile', function () {
['zoinks', 1.1, -1, 27].forEach(function (angle) {
assert.throws(function () {
sharp().tile({
angle: angle
angle
});
});
});
Expand Down

0 comments on commit a41c62b

Please sign in to comment.