Skip to content

feat(lint/css): add noDeprecatedMediaType#8861

Merged
dyc3 merged 1 commit intomainfrom
dyc3/no-deprecated-media-type
Jan 28, 2026
Merged

feat(lint/css): add noDeprecatedMediaType#8861
dyc3 merged 1 commit intomainfrom
dyc3/no-deprecated-media-type

Conversation

@dyc3
Copy link
Contributor

@dyc3 dyc3 commented Jan 25, 2026

Summary

Port https://stylelint.io/user-guide/rules/media-type-no-deprecated/

First draft was generated by gpt-5.2-codex, but I ended up throwing out most of it.

Test Plan

snapshots

Docs

@changeset-bot
Copy link

changeset-bot bot commented Jan 25, 2026

🦋 Changeset detected

Latest commit: a61c1d3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added A-Project Area: project A-Linter Area: linter L-CSS Language: CSS A-Diagnostic Area: diagnostocis labels Jan 25, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 25, 2026

Walkthrough

Adds a new CSS lint rule noDeprecatedMediaType that flags deprecated media types (aural, braille, embossed, handheld, projection, speech, tty, tv). Implements NoDeprecatedMediaType rule and NoDeprecatedMediaTypeOptions (case‑insensitive allow list), exports the options module, and adds tests: invalid.css, valid.css, and valid-allowed.css with corresponding .options.json. Also adds a changeset for a patch release.

Suggested reviewers

  • ematipico
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding a new CSS lint rule called noDeprecatedMediaType.
Description check ✅ Passed The description explains the motivation (porting a Stylelint rule), mentions AI assistance was used initially, and outlines the test approach via snapshots.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@crates/biome_css_analyze/src/lint/nursery/no_deprecated_media_type.rs`:
- Around line 137-142: The test module can't see DEPRECATED_MEDIA_TYPES; bring
it into scope by adding a use statement inside mod tests (e.g., add use
super::DEPRECATED_MEDIA_TYPES; or uncomment use super::*;) so the
builtin_list_is_sorted test can reference DEPRECATED_MEDIA_TYPES, or
alternatively change the constant's visibility to pub(crate) if the test lives
in a different module.
- Around line 79-92: The current check uses
DEPRECATED_MEDIA_TYPES.binary_search(&media_type) which is case-sensitive, so
media types like "TV" are missed; normalize the media type to a consistent case
before checking (e.g., compute a lowercase form of the media_type string such as
media_type.to_ascii_lowercase() or otherwise compare using a case-insensitive
equality) and perform the membership check against DEPRECATED_MEDIA_TYPES using
that normalized value (or ensure DEPRECATED_MEDIA_TYPES is stored in the same
lowercase form) where the binary_search is done; update the code around the
media_type variable and the DEPRECATED_MEDIA_TYPES.binary_search call to use the
normalized media type.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 25, 2026

Merging this PR will not alter performance

✅ 29 untouched benchmarks
⏩ 126 skipped benchmarks1


Comparing dyc3/no-deprecated-media-type (a61c1d3) with main (95f1eea)

Open in CodSpeed

Footnotes

  1. 126 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@dyc3 dyc3 force-pushed the dyc3/no-deprecated-media-type branch 2 times, most recently from ae62355 to 7031822 Compare January 25, 2026 17:25
@dyc3 dyc3 force-pushed the dyc3/no-deprecated-media-type branch from 7031822 to 1324957 Compare January 28, 2026 14:24
@dyc3 dyc3 force-pushed the dyc3/no-deprecated-media-type branch from 1324957 to a61c1d3 Compare January 28, 2026 14:31
@dyc3 dyc3 merged commit 3531687 into main Jan 28, 2026
20 checks passed
@dyc3 dyc3 deleted the dyc3/no-deprecated-media-type branch January 28, 2026 14:49
@github-actions github-actions bot mentioned this pull request Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Diagnostic Area: diagnostocis A-Linter Area: linter A-Project Area: project L-CSS Language: CSS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants