Skip to content

Commit b374189

Browse files
committed
chore: fix linting issues
Signed-off-by: Jakub Freisler <[email protected]>
1 parent 5da0aac commit b374189

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

src/plugins.ts

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,12 @@ export const initPlugin = (
133133
maxDiffThreshold: number;
134134
diffConfig: Parameters<typeof pixelmatch>[5];
135135
} & Parameters<typeof pixelmatch>[5]
136-
): Promise<
137-
null | {
138-
error?: boolean;
139-
message?: string;
140-
imgDiff?: number;
141-
maxDiffThreshold?: number;
142-
}
143-
> {
136+
): Promise<null | {
137+
error?: boolean;
138+
message?: string;
139+
imgDiff?: number;
140+
maxDiffThreshold?: number;
141+
}> {
144142
const messages = [] as string[];
145143
let imgDiff: number | undefined;
146144
let error = false;
@@ -174,11 +172,19 @@ export const initPlugin = (
174172
imgDiff = diffPixels / (width * height);
175173

176174
if (isImgSizeDifferent) {
177-
messages.push(`Warning: Images size mismatch - new screenshot is ${rawImgNew.width}px by ${rawImgNew.height}px while old one is ${rawImgOld.width}px by ${rawImgOld.height} (width x height).`);
175+
messages.push(
176+
`Warning: Images size mismatch - new screenshot is ${rawImgNew.width}px by ${rawImgNew.height}px while old one is ${rawImgOld.width}px by ${rawImgOld.height} (width x height).`
177+
);
178178
}
179-
179+
180180
if (imgDiff > cfg.maxDiffThreshold) {
181-
messages.unshift(`Image diff factor (${round(imgDiff)}) is bigger than maximum threshold option ${cfg.maxDiffThreshold}.`);
181+
messages.unshift(
182+
`Image diff factor (${round(
183+
imgDiff
184+
)}) is bigger than maximum threshold option ${
185+
cfg.maxDiffThreshold
186+
}.`
187+
);
182188
error = true;
183189
}
184190

@@ -189,7 +195,7 @@ export const initPlugin = (
189195
);
190196
return {
191197
error,
192-
message: messages.join('\n'),
198+
message: messages.join("\n"),
193199
imgDiff,
194200
maxDiffThreshold: cfg.maxDiffThreshold,
195201
};
@@ -204,9 +210,15 @@ export const initPlugin = (
204210
}
205211

206212
if (typeof imgDiff !== "undefined") {
207-
messages.unshift(`Image diff (${round(imgDiff)}%) is within boundaries of maximum threshold option ${cfg.maxDiffThreshold}.`);
213+
messages.unshift(
214+
`Image diff (${round(
215+
imgDiff
216+
)}%) is within boundaries of maximum threshold option ${
217+
cfg.maxDiffThreshold
218+
}.`
219+
);
208220
return {
209-
message: messages.join('\n'),
221+
message: messages.join("\n"),
210222
imgDiff,
211223
maxDiffThreshold: cfg.maxDiffThreshold,
212224
};

0 commit comments

Comments
 (0)