mirror of
https://github.com/zoriya/v10.git
synced 2026-08-06 14:18:10 +00:00
chore: fix repo biome lint errors (#804)
This commit is contained in:
+4
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.4.2/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/2.4.6/schema.json",
|
||||
"html": {
|
||||
"experimentalFullSupportEnabled": false
|
||||
},
|
||||
@@ -125,10 +125,13 @@
|
||||
"includes": [
|
||||
"**",
|
||||
"!**/.astro",
|
||||
"!**/.netlify",
|
||||
"!**/.vercel",
|
||||
"!**/.turbo",
|
||||
"!**/.next",
|
||||
"!**/.opencode",
|
||||
"!**/.github",
|
||||
"!build",
|
||||
"!**/dist",
|
||||
"!**/examples",
|
||||
"!**/styles/vjs.css",
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -15,14 +15,6 @@
|
||||
z-index: 30;
|
||||
}
|
||||
|
||||
.html-buffering-indicator-basic__overlay .html-buffering-indicator-basic__spinner {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.html-buffering-indicator-basic__overlay[data-visible] .html-buffering-indicator-basic__spinner {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.html-buffering-indicator-basic__spinner {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
@@ -30,6 +22,11 @@
|
||||
border-top-color: white;
|
||||
border-radius: 50%;
|
||||
animation: buffering-spin 0.8s linear infinite;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.html-buffering-indicator-basic__overlay[data-visible] .html-buffering-indicator-basic__spinner {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@keyframes buffering-spin {
|
||||
|
||||
@@ -15,14 +15,6 @@
|
||||
z-index: 30;
|
||||
}
|
||||
|
||||
.react-buffering-indicator-basic__overlay .react-buffering-indicator-basic__spinner {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.react-buffering-indicator-basic__overlay[data-visible] .react-buffering-indicator-basic__spinner {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.react-buffering-indicator-basic__spinner {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
@@ -30,6 +22,11 @@
|
||||
border-top-color: white;
|
||||
border-radius: 50%;
|
||||
animation: buffering-spin 0.8s linear infinite;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.react-buffering-indicator-basic__overlay[data-visible] .react-buffering-indicator-basic__spinner {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@keyframes buffering-spin {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useStore } from '@nanostores/react';
|
||||
import { createPlayer, Poster } from '@videojs/react';
|
||||
import { HlsVideo } from '@videojs/react/media/hls-video';
|
||||
import { MinimalVideoSkin, Video, VideoSkin, videoFeatures } from '@videojs/react/video';
|
||||
import { VJS10_DEMO_VIDEO } from '@/consts';
|
||||
import { skin } from '@/stores/homePageDemos';
|
||||
@@ -27,7 +26,6 @@ export default function HeroVideo({
|
||||
className={className}
|
||||
style={{ '--media-border-radius': `calc(var(--spacing) * 6)`, ...style } as React.CSSProperties}
|
||||
>
|
||||
{/*<HlsVideo src={VJS10_DEMO_VIDEO.hls} playsInline style={{ objectFit: 'cover' }} />*/}
|
||||
<Video src={VJS10_DEMO_VIDEO.mp4} playsInline style={{ objectFit: 'cover' }} />
|
||||
<Poster src={poster} />
|
||||
</SkinComponent>
|
||||
|
||||
@@ -76,7 +76,15 @@ export const AmazonLogo = ({ width = '1', ...props }: IconProps) => {
|
||||
};
|
||||
export const AwgeLogo = ({ width = '1', ...props }: IconProps) => {
|
||||
return (
|
||||
<svg width="128" height="36" viewBox="0 0 128 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg
|
||||
aria-label="Awge Logo"
|
||||
role="img"
|
||||
width="128"
|
||||
height="36"
|
||||
viewBox="0 0 128 36"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
@@ -108,7 +116,15 @@ export const ZoomLogo = ({ width = '1', ...props }: IconProps) => {
|
||||
};
|
||||
export const CourseraLogo = ({ width = '1', ...props }: IconProps) => {
|
||||
return (
|
||||
<svg width="120" height="17" viewBox="0 0 120 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg
|
||||
aria-label="Coursera Logo"
|
||||
role="img"
|
||||
width="120"
|
||||
height="17"
|
||||
viewBox="0 0 120 17"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
@@ -156,7 +172,15 @@ export const ConsumerReports = ({ width = '1', ...props }: IconProps) => {
|
||||
};
|
||||
export const TheOnionLogo = ({ width = '1', ...props }: IconProps) => {
|
||||
return (
|
||||
<svg width="130" height="21" viewBox="0 0 130 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg
|
||||
aria-label="The Onion Logo"
|
||||
role="img"
|
||||
width="130"
|
||||
height="21"
|
||||
viewBox="0 0 130 21"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
|
||||
@@ -265,24 +265,20 @@
|
||||
|
||||
@utility text-stroke-faded-black {
|
||||
color: transparent;
|
||||
-webkit-text-stroke: 1.5px var(--color-faded-black);
|
||||
-webkit-text-stroke: clamp(1px, 0.035em, 1.5px) var(--color-faded-black);
|
||||
|
||||
&::selection {
|
||||
color: transparent;
|
||||
-webkit-text-stroke: 1.5px var(--color-faded-black);
|
||||
-webkit-text-stroke: clamp(1px, 0.035em, 1.5px) var(--color-faded-black);
|
||||
}
|
||||
}
|
||||
|
||||
@utility text-stroke-manila-light {
|
||||
color: transparent;
|
||||
-webkit-text-stroke: 1.5px var(--color-manila-light);
|
||||
-webkit-text-stroke: clamp(1px, 0.035em, 1.5px) var(--color-manila-light);
|
||||
|
||||
&::selection {
|
||||
color: transparent;
|
||||
-webkit-text-stroke: 1.5px var(--color-faded-black);
|
||||
-webkit-text-stroke: clamp(1px, 0.035em, 1.5px) var(--color-faded-black);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user