Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#4,382 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Yi-111-a がすでに取り組んでいます。

2026年9月30日 から。

  • #4392 @leorivastech による — マージされずにクローズ
  • #4779 @Yi-111-a による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
91/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
bun, typescript

調査の方向性

packages/lint/src/rules/media.ts の既知の拡張子セットから始め、次に packages/lint/src/rules/media.test.ts の関連するケースを読んでください。M4A と AVIF の回帰テストを追加し、正しく受け入れられる要素と、既存のサフィックスおよび大文字・小文字の動作を含めてください。その後、再現手順と、指定された lint テスト、oxlint、oxfmt の各コマンドを実行してください。未知の拡張子に対する動作を変更せず、両方の不一致で既存の診断が生成されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
54.1k
フォーク
4.9k
平均マージ
7時間 19分
マージ済み PR(30日)
746

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

heygen-com/hyperframes のほかの issue

heygen-com/hyperframes の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。