Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

lint: report AVIF/M4A media-kind mismatches consistently with JPEG/MP3

Aperta Adatta ai principianti
#4,382 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Yi-111-a ci sta già lavorando.

Dal 30/9/2026.

  • #4392 di @leorivastech — chiusa senza merge
  • #4779 di @Yi-111-a — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
91/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bun, typescript

Direzione di ricerca

Inizia da packages/lint/src/rules/media.ts, negli insiemi di estensioni noti, quindi leggi i casi correlati in packages/lint/src/rules/media.test.ts. Aggiungi una copertura di regressione per M4A e AVIF, includendo gli elementi corretti accettati e il comportamento esistente per suffissi e maiuscole/minuscole, quindi esegui la riproduzione e i comandi specificati per il test lint, oxlint e oxfmt. Il lavoro è completato quando entrambe le discrepanze producono la diagnostica esistente senza modificare il comportamento per le estensioni sconosciute.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug difficulty/easy triage/ready

The existing media-kind rule catches an image element pointing to MP3 or a video element pointing to JPEG, but misses the same mistakes for M4A and AVIF. Those two known formats are absent from the extension sets.

Reproduction

From the repository root:

cat > /tmp/hf-d7.ts <<'TS'
const { lintHyperframeHtml } = await import(`${process.cwd()}/packages/lint/src/hyperframeLinter.ts`);
const wrap = (body: string) => `<html><body><div id="main" data-composition-id="main" data-no-timeline data-width="1920" data-height="1080" data-duration="10">${body}</div></body></html>`;
for (const file of ["voice.mp3", "voice.m4a", "photo.jpg", "photo.avif"]) {
  const body = file.startsWith("voice") ? `<img id="img" src="${file}">` : `<video id="v" muted data-start="0" data-duration="3" src="${file}"></video>`;
  console.log(file, (await lintHyperframeHtml(wrap(body))).findings.map((f: {code: string}) => f.code));
}
TS
bun /tmp/hf-d7.ts

Observed:

voice.mp3 [ "media_src_kind_mismatch" ]
voice.m4a []
photo.jpg [ "media_src_kind_mismatch" ]
photo.avif []

Expected: all four incorrect tag/source combinations receive media_src_kind_mismatch; the M4A case is identified as audio and AVIF as image.

Scope and suggested approach

Update the known extension sets in media.ts and add regression cases to media.test.ts. AVIF is already covered by engine file-server tests; M4A is used in audioMixer tests.

Limit the change to these established extensions. Do not add network probing or assume the kind of ambiguous containers such as OGG.

Acceptance criteria

  • Both missing cases produce the existing diagnostic with accurate audio/image wording.
  • Correct AVIF image and M4A audio elements remain accepted by this rule.
  • Uppercase extensions and URL query/hash suffixes work consistently with existing supported extensions.
  • Unknown extensions remain conservative and existing media-rule tests pass.

Estimated difficulty: easy. Reviewer/mentor: pending.

Related work

PRs #3741 and #3609 introduced the existing media-kind checks and are reflected in current source. This is a bounded follow-up for two missing extensions; no active matching follow-up was found in the checked inventory.

Validation

From a dependency-installed repository checkout, run the reproduction above with Bun. It imports source directly and does not need real media files, Chrome, or FFmpeg. Add regression cases in the linked existing suite, then run:

bun run --cwd packages/lint test src/rules/media.test.ts
bunx oxlint packages/lint/src/rules/media.ts packages/lint/src/rules/media.test.ts
bunx oxfmt --check packages/lint/src/rules/media.ts packages/lint/src/rules/media.test.ts

Discovery ran the minimal source-level reproduction, not the full test suite or a video render. Reproduced on fa4261beea63bb4f36ff6a2f20fb4646fae3f2c6 (0.8.68); relevant source is unchanged on origin/main at 86fa10ced4297bfd9f4fe67b6767afae7a07fd3c (0.8.69).

Overlap refresh: checked open issue/PR titles and bodies from the fresh publication inventory on 2026-09-23; no matching active implementation found. Before starting, check the discussion and linked PRs, then comment with your intended approach so ownership can be coordinated.

Lingua principale
TypeScript
Stelle
54.1k
Fork
4.9k
Merge medio
7h 19m
PR unite (30g)
746

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di heygen-com/hyperframes

Tutte le issue di heygen-com/hyperframes

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.