mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: enable no-useless-template-literals rule (#11573)
This commit is contained in:
parent
66aa770038
commit
42b03a67d0
@ -185,6 +185,7 @@ module.exports = {
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
// We allow non-null assertions if the value was asserted using `assert` API.
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/no-useless-template-literals': 'error',
|
||||
/**
|
||||
* This is the default options (as per
|
||||
* https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/docs/rules/ban-types.md),
|
||||
|
@ -324,7 +324,7 @@ export function getFeatures(flag: string, options: string[] = []): string[] {
|
||||
return s.startsWith(flag.endsWith('=') ? flag : `${flag}=`);
|
||||
})
|
||||
.map(s => {
|
||||
return s.split(new RegExp(`${flag}` + '=\\s*'))[1]?.trim();
|
||||
return s.split(new RegExp(`${flag}=\\s*`))[1]?.trim();
|
||||
})
|
||||
.filter(s => {
|
||||
return s;
|
||||
|
@ -99,11 +99,11 @@ export class ScreenRecorder extends PassThrough {
|
||||
// Reduces initial buffering while analyzing input fps and other stats.
|
||||
[
|
||||
'-fpsprobesize',
|
||||
`${0}`,
|
||||
'0',
|
||||
'-probesize',
|
||||
`${32}`,
|
||||
'32',
|
||||
'-analyzeduration',
|
||||
`${0}`,
|
||||
'0',
|
||||
'-fflags',
|
||||
'nobuffer',
|
||||
],
|
||||
@ -120,13 +120,13 @@ export class ScreenRecorder extends PassThrough {
|
||||
// Specifies the encoding and format we are using.
|
||||
this.#getFormatArgs(format ?? 'webm'),
|
||||
// Disable bitrate.
|
||||
['-b:v', `${0}`],
|
||||
['-b:v', '0'],
|
||||
// Filters to ensure the images are piped correctly.
|
||||
[
|
||||
'-vf',
|
||||
`${
|
||||
speed ? `setpts=${1 / speed}*PTS,` : ''
|
||||
}crop='min(${width},iw):min(${height},ih):${0}:${0}',pad=${width}:${height}:${0}:${0}${
|
||||
}crop='min(${width},iw):min(${height},ih):0:0',pad=${width}:${height}:0:0${
|
||||
crop ? `,crop=${crop.width}:${crop.height}:${crop.x}:${crop.y}` : ''
|
||||
}${scale ? `,scale=iw*${scale}:-1` : ''}`,
|
||||
],
|
||||
@ -204,7 +204,7 @@ export class ScreenRecorder extends PassThrough {
|
||||
// Sets the quality. Lower the better.
|
||||
['-crf', `${CRF_VALUE}`],
|
||||
// Sets the quality and how efficient the compression will be.
|
||||
['-deadline', 'realtime', '-cpu-used', `${8}`],
|
||||
['-deadline', 'realtime', '-cpu-used', '8'],
|
||||
].flat();
|
||||
case 'gif':
|
||||
return [
|
||||
|
@ -62,7 +62,7 @@ export function rewriteError(
|
||||
export function createProtocolErrorMessage(object: {
|
||||
error: {message: string; data: any; code: number};
|
||||
}): string {
|
||||
let message = `${object.error.message}`;
|
||||
let message = object.error.message;
|
||||
// TODO: remove the type checks when we stop connecting to BiDi with a CDP
|
||||
// client.
|
||||
if (
|
||||
|
Loading…
Reference in New Issue
Block a user