Skip to content

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

Open

Description

@jrusso1020

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.

Activity

  1. added
    difficulty/easyLocalized change with a known approach, limited risk, and straightforward verification.
    enhancementNew feature or request
    triage/readyAccepted scope, current evidence, acceptance criteria, and validation path are recorded.
    help wantedReady, available work with maintainer review support; any difficulty.
    good first issueEasy, available, ready work with code/test pointers and a confirmed newcomer mentor.
    on Nov 6, 2026
  2. wanjinhao1 commented on Nov 6, 2026

    @wanjinhao1

    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.

  3. added a commit that references this issue on Nov 10, 2026
    94cb1a3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty/easyLocalized change with a known approach, limited risk, and straightforward verification.enhancementNew feature or requestgood first issueEasy, available, ready work with code/test pointers and a confirmed newcomer mentor.help wantedReady, available work with maintainer review support; any difficulty.triage/readyAccepted scope, current evidence, acceptance criteria, and validation path are recorded.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions