mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
chore: fix repo biome lint errors (#804)
This commit is contained in:
@@ -3,14 +3,14 @@ export type StateAttrMap<State> = {
|
||||
};
|
||||
|
||||
/** Constraint for core UI classes that compute component state. */
|
||||
export interface UIComponent<Props = {}, State extends object = object> {
|
||||
export interface UIComponent<Props = object, State extends object = object> {
|
||||
getState(): State;
|
||||
setProps?(props: Props): void;
|
||||
getAttrs?(state: State): object;
|
||||
}
|
||||
|
||||
/** Constraint for core UI classes that derive component state from media state. */
|
||||
export interface MediaUIComponent<Props = {}, State extends object = object> extends UIComponent<Props, State> {
|
||||
export interface MediaUIComponent<Props = object, State extends object = object> extends UIComponent<Props, State> {
|
||||
setMedia(media: object): void;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,8 @@ export function createContainerMixin<Store extends PlayerStore>(context: PlayerC
|
||||
const store = this.#contextStore ?? this.store;
|
||||
if (!store) return;
|
||||
|
||||
const media = this.querySelector<HTMLMediaElement>('video, audio, [data-media-element]') ?? this.#getSlottedMedia();
|
||||
const media =
|
||||
this.querySelector<HTMLMediaElement>('video, audio, [data-media-element]') ?? this.#getSlottedMedia();
|
||||
|
||||
if (!media) {
|
||||
this.#detach();
|
||||
|
||||
@@ -76,7 +76,7 @@ try {
|
||||
const percentOfTarget = ((gzippedSize / 1024 / targetKB) * 100).toFixed(1);
|
||||
|
||||
// Display results
|
||||
console.log('\n' + '='.repeat(50));
|
||||
console.log(`\n${'='.repeat(50)}`);
|
||||
console.log(`📊 Bundle Size Report - ${label}`);
|
||||
console.log('='.repeat(50));
|
||||
console.log(`Minified: ${formatSize(minifiedSize)}`);
|
||||
@@ -85,7 +85,7 @@ try {
|
||||
console.log(`Target: ${targetKB} KB (minified + gzipped)`);
|
||||
console.log(`Used: ${percentOfTarget}%`);
|
||||
console.log(`Remaining: ${formatSize(targetKB * 1024 - gzippedSize)}`);
|
||||
console.log('='.repeat(50) + '\n');
|
||||
console.log(`${'='.repeat(50)}\n`);
|
||||
|
||||
// Status indicator
|
||||
if (gzippedSize / 1024 > targetKB) {
|
||||
|
||||
@@ -151,7 +151,6 @@ class StateContainer<T> implements WritableState<T> {
|
||||
|
||||
// Apply partial updates with change detection
|
||||
for (const key in partial) {
|
||||
// biome-ignore lint/suspicious/noExplicitAny: T may be a primitive; `partial` is object-shaped at this branch
|
||||
if (!Object.hasOwn(partial as any, key)) continue;
|
||||
|
||||
const value = (partial as Partial<T>)[key as keyof T];
|
||||
|
||||
@@ -205,7 +205,7 @@ function getMaxBufferedEnd(owners: EndOfStreamOwners): number {
|
||||
*/
|
||||
const endOfStreamTask = async (
|
||||
{ currentOwners }: { currentOwners: EndOfStreamOwners },
|
||||
_context: {}
|
||||
_context: object
|
||||
): Promise<void> => {
|
||||
const { mediaSource } = currentOwners;
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ export function shouldUpdateDuration(state: DurationUpdateState, owners: Duratio
|
||||
// task or by endOfStreamTask from buffered.end()), we leave it alone — attempting
|
||||
// to re-sync a slight drift between mediaSource.duration and presentation.duration
|
||||
// races with concurrent appendBuffer() calls from loadSegmentsTask.
|
||||
return isNaN(mediaSource!.duration);
|
||||
return Number.isNaN(mediaSource!.duration);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,7 +76,7 @@ export function shouldUpdateDuration(state: DurationUpdateState, owners: Duratio
|
||||
*/
|
||||
function waitForSourceBuffersReady(owners: DurationUpdateOwners): Promise<void> {
|
||||
const updating = [owners.videoSourceBuffer, owners.audioSourceBuffer].filter(
|
||||
(buf): buf is SourceBuffer => buf !== undefined && buf.updating
|
||||
(buf): buf is SourceBuffer => buf?.updating === true
|
||||
);
|
||||
|
||||
if (updating.length === 0) return Promise.resolve();
|
||||
|
||||
@@ -8,7 +8,7 @@ function makeSourceBuffer(): SourceBuffer {
|
||||
updating: false,
|
||||
remove: vi.fn(() => {
|
||||
setTimeout(() => {
|
||||
for (const listener of listeners['updateend'] ?? []) {
|
||||
for (const listener of listeners.updateend ?? []) {
|
||||
listener(new Event('updateend'));
|
||||
}
|
||||
}, 0);
|
||||
@@ -45,7 +45,7 @@ describe('flushBuffer', () => {
|
||||
updating: true,
|
||||
remove: vi.fn(() => {
|
||||
setTimeout(() => {
|
||||
for (const listener of listeners['updateend'] ?? []) {
|
||||
for (const listener of listeners.updateend ?? []) {
|
||||
listener(new Event('updateend'));
|
||||
}
|
||||
}, 0);
|
||||
@@ -82,7 +82,7 @@ describe('flushBuffer', () => {
|
||||
updating: false,
|
||||
remove: vi.fn(() => {
|
||||
setTimeout(() => {
|
||||
for (const listener of listeners['error'] ?? []) {
|
||||
for (const listener of listeners.error ?? []) {
|
||||
listener(new Event('error'));
|
||||
}
|
||||
}, 0);
|
||||
|
||||
Reference in New Issue
Block a user