hyperframes icon indicating copy to clipboard operation
hyperframes copied to clipboard

Lint: flag data-volume values that are not numbers or fall outside 0 to 3.98

Open jrusso1020 opened this issue 4 weeks ago • 1 comments

The documented range for data-volume is 0 to 3.98 (+12 dB) (docs/reference/html-schema.mdx). Values outside it are clamped silently (packages/core/src/audioGain.ts, around line 25), and non-numbers fall back to 1. So data-volume="80" (someone writing a percent) plays as a +12 dB boost, and data-volume="loud" plays at normal volume. Lint reports neither.

Scope

  • Warn when data-volume isn't a finite number, or is below 0 or above 3.98.
  • The lint package doesn't depend on core, so add a test that keeps the 3.98 limit in sync with audioGain.ts.

Files: packages/lint/src/rules/media.ts, packages/lint/src/rules/media.test.ts

Done when: a test shows 80, -1 and loud warn, while 0, 1 and 3.98 don't.

Mentor: @jrusso1020. Comment here before you start so we can avoid duplicate PRs.

jrusso1020 avatar Nov 06 '26 00:11 jrusso1020

Hi, I'd like to take this one — I'll add the data-volume lint warnings in packages/lint/src/rules/media.ts with tests for 80, -1, loud (warn) and 0, 1, 3.98 (no warn), plus the limit-sync test against audioGain.ts.

wanjinhao1 avatar Nov 06 '26 02:11 wanjinhao1