Skip to content

Commit 359197f

Browse files
chore(deps): update dependency prettier to v3 (video-dev#5646)
* chore(deps): update dependency prettier to v3 * run prettier --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Tom Jenkinson <[email protected]>
1 parent 07db3b9 commit 359197f

File tree

146 files changed

+1914
-1897
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+1914
-1897
lines changed

build-config.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const istanbul = require('rollup-plugin-istanbul');
1010
const fs = require('fs');
1111

1212
const pkgJson = JSON.parse(
13-
fs.readFileSync('./package.json', { encoding: 'utf-8' })
13+
fs.readFileSync('./package.json', { encoding: 'utf-8' }),
1414
);
1515

1616
const BUILD_TYPE = {
@@ -53,24 +53,24 @@ const buildConstants = (type, additional = {}) => ({
5353
values: {
5454
__VERSION__: JSON.stringify(pkgJson.version),
5555
__USE_SUBTITLES__: JSON.stringify(
56-
type === BUILD_TYPE.full || addSubtitleSupport
56+
type === BUILD_TYPE.full || addSubtitleSupport,
5757
),
5858
__USE_ALT_AUDIO__: JSON.stringify(
59-
type === BUILD_TYPE.full || addAltAudioSupport
59+
type === BUILD_TYPE.full || addAltAudioSupport,
6060
),
6161
__USE_EME_DRM__: JSON.stringify(type === BUILD_TYPE.full || addEMESupport),
6262
__USE_CMCD__: JSON.stringify(type === BUILD_TYPE.full || addCMCDSupport),
6363
__USE_CONTENT_STEERING__: JSON.stringify(
64-
type === BUILD_TYPE.full || addContentSteeringSupport
64+
type === BUILD_TYPE.full || addContentSteeringSupport,
6565
),
6666
__USE_VARIABLE_SUBSTITUTION__: JSON.stringify(
67-
type === BUILD_TYPE.full || addVariableSubstitutionSupport
67+
type === BUILD_TYPE.full || addVariableSubstitutionSupport,
6868
),
6969
__USE_M2TS_ADVANCED_CODECS__: JSON.stringify(
70-
type === BUILD_TYPE.full || addM2TSAdvancedCodecSupport
70+
type === BUILD_TYPE.full || addM2TSAdvancedCodecSupport,
7171
),
7272
__USE_MEDIA_CAPABILITIES__: JSON.stringify(
73-
type === BUILD_TYPE.full || addMediaCapabilitiesSupport
73+
type === BUILD_TYPE.full || addMediaCapabilitiesSupport,
7474
),
7575

7676
...additional,
@@ -132,15 +132,15 @@ const babelTsWithPresetEnvTargets = ({ targets, stripConsole }) =>
132132
espath.node.callee = importHelper.addNamed(
133133
espath,
134134
'isFiniteNumber',
135-
path.resolve('src/polyfills/number')
135+
path.resolve('src/polyfills/number'),
136136
);
137137
} else if (
138138
espath.get('callee').matchesPattern('Number.MAX_SAFE_INTEGER')
139139
) {
140140
espath.node.callee = importHelper.addNamed(
141141
espath,
142142
'MAX_SAFE_INTEGER',
143-
path.resolve('src/polyfills/number')
143+
path.resolve('src/polyfills/number'),
144144
);
145145
}
146146
},
@@ -344,7 +344,7 @@ const configs = Object.entries({
344344
replace(
345345
buildConstants(BUILD_TYPE.full, {
346346
__IN_WORKER__: JSON.stringify(true),
347-
})
347+
}),
348348
),
349349
buildBabelLegacyBrowsers({ stripConsole: true }),
350350
terser(),
@@ -377,7 +377,7 @@ const configs = Object.entries({
377377
branch: env.CF_PAGES_BRANCH,
378378
commitRef: env.CF_PAGES_COMMIT_SHA,
379379
}
380-
: null
380+
: null,
381381
),
382382
},
383383
}),

demo/benchmark.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

demo/index-light.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html>
33
<head>
44
<meta charset="utf-8" />

demo/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html>
33
<head>
44
<meta charset="utf-8" />

demo/metrics.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22

33
<head>
44
<title>hls.js metrics page</title>

docs/API.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ You need to provide manifest URL as below:
235235
});
236236
hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {
237237
console.log(
238-
'manifest loaded, found ' + data.levels.length + ' quality level'
238+
'manifest loaded, found ' + data.levels.length + ' quality level',
239239
);
240240
});
241241
hls.loadSource('http://my.streamURL.com/playlist.m3u8');

lint-staged.config.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
const micromatch = require('micromatch');
22
const prettier = require('prettier');
33

4-
const prettierSupportedExtensions = prettier
5-
.getSupportInfo()
6-
.languages.map(({ extensions }) => extensions)
7-
.flat();
84
const addQuotes = (a) => `"${a}"`;
95

10-
module.exports = (allStagedFiles) => {
6+
module.exports = async (allStagedFiles) => {
7+
const prettierSupportedExtensions = (
8+
await prettier.getSupportInfo()
9+
).languages
10+
.map(({ extensions }) => extensions)
11+
.flat();
12+
1113
const eslintFiles = micromatch(allStagedFiles, '**/*.{js,ts}');
1214
const prettierFiles = micromatch(
1315
allStagedFiles,
14-
prettierSupportedExtensions.map((extension) => `**/*${extension}`)
16+
prettierSupportedExtensions.map((extension) => `**/*${extension}`),
1517
);
1618

1719
return [

package-lock.json

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
"mocha": "10.2.0",
117117
"node-fetch": "3.3.2",
118118
"npm-run-all": "4.1.5",
119-
"prettier": "2.8.8",
119+
"prettier": "3.0.1",
120120
"promise-polyfill": "8.3.0",
121121
"rollup": "3.28.0",
122122
"rollup-plugin-istanbul": "4.0.0",

rollup.config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ module.exports = ({ configType = [] }) => {
1313
} else {
1414
// Filter out enabled configs
1515
const enabledEntries = configs.filter(([name]) =>
16-
requestedConfigs.includes(name)
16+
requestedConfigs.includes(name),
1717
);
1818
if (!enabledEntries.length) {
1919
throw new Error(
2020
`Couldn't find a valid config with the names ${JSON.stringify(
21-
requestedConfigs
22-
)}. Known configs are: ${configs.map(([name]) => name).join(', ')}`
21+
requestedConfigs,
22+
)}. Known configs are: ${configs.map(([name]) => name).join(', ')}`,
2323
);
2424
}
2525
configEntries = enabledEntries;
2626
}
2727

2828
console.log(
29-
`Building configs: ${configEntries.map(([name]) => name).join(', ')}.\n`
29+
`Building configs: ${configEntries.map(([name]) => name).join(', ')}.\n`,
3030
);
3131
return configEntries.map(([, config]) => config);
3232
};

scripts/check-already-published.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ async function versionPublished() {
2424
//https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md
2525
const response = await fetch(
2626
`https://registry.npmjs.org/${encodeURIComponent(
27-
packageJson.name
28-
)}/${encodeURIComponent(packageJson.version)}`
27+
packageJson.name,
28+
)}/${encodeURIComponent(packageJson.version)}`,
2929
);
3030
if (response.status === 200) {
3131
return true;

scripts/get-package-version.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ try {
2323
// 1.2.3-0.caaanary.custom => bad
2424
// 1.2.3-0.caaanary.custom.0.canary.503 => now lower than 1.2.3-0.canary.501
2525
throw new Error(
26-
`It's possible that "${newVersion}" has a lower precedense than an existing canary version which is not allowed.`
26+
`It's possible that "${newVersion}" has a lower precedense than an existing canary version which is not allowed.`,
2727
);
2828
}
2929
} else {
@@ -44,7 +44,7 @@ try {
4444
const suffix = process.env.CF_PAGES
4545
? `pr.${process.env.CF_PAGES_BRANCH.replace(
4646
/[^a-zA-Z-]/g,
47-
'-'
47+
'-',
4848
)}.${getCommitHash().slice(0, 8)}`
4949
: `0.canary.${getCommitNum()}`;
5050

@@ -53,18 +53,18 @@ try {
5353

5454
if (!versionParser.isGreaterOrEqual(newVersion, latestVersion)) {
5555
throw new Error(
56-
`New version "${newVersion}" is not >= latest version "${latestVersion}" on this branch.`
56+
`New version "${newVersion}" is not >= latest version "${latestVersion}" on this branch.`,
5757
);
5858
}
5959

6060
const foundPreviousVersion = versionParser
6161
.getPotentialPreviousStableVersions(`v${newVersion}`)
6262
.every((potentialPreviousVersion) =>
63-
hasTag(`v${potentialPreviousVersion}`)
63+
hasTag(`v${potentialPreviousVersion}`),
6464
);
6565
if (!foundPreviousVersion) {
6666
throw new Error(
67-
'Could not find a previous version. The tag must follow a previous stable version number.'
67+
'Could not find a previous version. The tag must follow a previous stable version number.',
6868
);
6969
}
7070

src/config.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export type DRMSystemConfiguration = {
8484
this: Hls,
8585
initDataType: string,
8686
initData: ArrayBuffer | null,
87-
keyContext: MediaKeySessionContext
87+
keyContext: MediaKeySessionContext,
8888
) =>
8989
| { initDataType: string; initData: ArrayBuffer | null }
9090
| undefined
@@ -101,13 +101,13 @@ export type EMEControllerConfig = {
101101
xhr: XMLHttpRequest,
102102
url: string,
103103
keyContext: MediaKeySessionContext,
104-
licenseChallenge: Uint8Array
104+
licenseChallenge: Uint8Array,
105105
) => void | Uint8Array | Promise<Uint8Array | void>;
106106
licenseResponseCallback?: (
107107
this: Hls,
108108
xhr: XMLHttpRequest,
109109
url: string,
110-
keyContext: MediaKeySessionContext
110+
keyContext: MediaKeySessionContext,
111111
) => ArrayBuffer;
112112
emeEnabled: boolean;
113113
widevineLicenseUrl?: string;
@@ -532,15 +532,15 @@ function timelineConfig(): TimelineControllerConfig {
532532
*/
533533
export function mergeConfig(
534534
defaultConfig: HlsConfig,
535-
userConfig: Partial<HlsConfig>
535+
userConfig: Partial<HlsConfig>,
536536
): HlsConfig {
537537
if (
538538
(userConfig.liveSyncDurationCount ||
539539
userConfig.liveMaxLatencyDurationCount) &&
540540
(userConfig.liveSyncDuration || userConfig.liveMaxLatencyDuration)
541541
) {
542542
throw new Error(
543-
"Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration"
543+
"Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration",
544544
);
545545
}
546546

@@ -551,7 +551,7 @@ export function mergeConfig(
551551
userConfig.liveSyncDurationCount)
552552
) {
553553
throw new Error(
554-
'Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"'
554+
'Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"',
555555
);
556556
}
557557

@@ -561,7 +561,7 @@ export function mergeConfig(
561561
userConfig.liveMaxLatencyDuration <= userConfig.liveSyncDuration)
562562
) {
563563
throw new Error(
564-
'Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"'
564+
'Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"',
565565
);
566566
}
567567

@@ -609,10 +609,10 @@ export function mergeConfig(
609609
if (report.length) {
610610
logger.warn(
611611
`hls.js config: "${report.join(
612-
'", "'
612+
'", "',
613613
)}" setting(s) are deprecated, use "${policyName}": ${JSON.stringify(
614-
userConfig[policyName]
615-
)}`
614+
userConfig[policyName],
615+
)}`,
616616
);
617617
}
618618
});
@@ -644,7 +644,7 @@ export function enableStreamingMode(config) {
644644
if (currentLoader !== FetchLoader && currentLoader !== XhrLoader) {
645645
// If a developer has configured their own loader, respect that choice
646646
logger.log(
647-
'[config]: Custom loader detected, cannot enable progressive streaming'
647+
'[config]: Custom loader detected, cannot enable progressive streaming',
648648
);
649649
config.progressive = false;
650650
} else {

0 commit comments

Comments
 (0)