Skip to content

feat(lint): add useReactNativePlatformComponents rule and options#10033

Merged
ematipico merged 8 commits into
mainfrom
feat/use-platform-components
Apr 22, 2026
Merged

feat(lint): add useReactNativePlatformComponents rule and options#10033
ematipico merged 8 commits into
mainfrom
feat/use-platform-components

Conversation

@ematipico

Copy link
Copy Markdown
Member

Summary

This PR adds the rule split-platform-components to the react native domain.

Generated via Claude Code. It went through different iterations.

The rule basically says that components that belong to a specific platform must be imported into files that match that platform, it's a bug (rule triggered). That's why it's an error, and recommended.

Test Plan

Added tests

Docs

Part of the rule

@changeset-bot

changeset-bot Bot commented Apr 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3f32ff2

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-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Diagnostic Area: diagnostocis labels Apr 18, 2026
@coderabbitai

coderabbitai Bot commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Adds a new nursery lint rule useReactNativePlatformComponents that inspects ES named imports and destructured require("react-native") calls, classifies identifiers as Android (name contains Android) or iOS (name contains IOS), and uses configurable glob patterns to determine platform-specific file matches. Emits diagnostics when platform-specific components are used in non-matching files and a combined conflict diagnostic when Android and iOS components are mixed in one file. Also adds rule options and defaults, a changeset entry, and multiple test fixtures exercising valid, invalid, and custom-option scenarios.

Suggested reviewers

  • dyc3
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(lint): add useReactNativePlatformComponents rule and options' directly and clearly describes the main change—addition of a new linter rule and its configuration options.
Description check ✅ Passed The description relates to the changeset by explaining the rule's purpose, referencing the source eslint plugin, disclosing AI assistance, and confirming tests were added.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/use-platform-components

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
crates/biome_rule_options/src/use_react_native_platform_components.rs (1)

9-17: Consider wrapping fields in Option<_> for merging semantics.

Per coding guidelines, rule option fields should be wrapped in Option<_> to distinguish user-set values from defaults during configuration merging. Currently, if a user specifies only androidPathRegex, the iosPathRegex will silently use the default rather than being recognised as unset.

This may be acceptable for this rule since regex patterns are unlikely to need "unsetting", but worth considering for consistency with other options structs.

🔧 Optional refactor to use Option wrappers
 pub struct UseReactNativePlatformComponentsOptions {
     /// A regular expression pattern to identify Android-specific files.
     /// Defaults to `.*[.]android[.][jt]sx?`.
-    pub android_path_regex: RestrictedRegex,
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub android_path_regex: Option<RestrictedRegex>,

     /// A regular expression pattern to identify iOS-specific files.
     /// Defaults to `.*[.]ios[.][jt]sx?`.
-    pub ios_path_regex: RestrictedRegex,
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub ios_path_regex: Option<RestrictedRegex>,
 }

Then in the rule, use options.android_path_regex.as_ref().unwrap_or(&default) or similar.

As per coding guidelines: "Wrap all rule option fields in Option<_> to properly track which options are set vs unset during configuration merging".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/biome_rule_options/src/use_react_native_platform_components.rs` around
lines 9 - 17, The struct UseReactNativePlatformComponentsOptions currently uses
concrete RestrictedRegex fields (android_path_regex, ios_path_regex) which
prevents distinguishing user-set vs default values during config merging; change
each field to Option<RestrictedRegex> (android_path_regex:
Option<RestrictedRegex>, ios_path_regex: Option<RestrictedRegex>) and update any
consumers (rule code that reads these fields) to use as_ref().map(|r| r) or
as_ref().unwrap_or(&default_pattern) / unwrap_or_else to fall back to the rule
defaults during evaluation so merging logic can detect unset vs explicitly
provided values.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@crates/biome_rule_options/src/use_react_native_platform_components.rs`:
- Around line 9-17: The struct UseReactNativePlatformComponentsOptions currently
uses concrete RestrictedRegex fields (android_path_regex, ios_path_regex) which
prevents distinguishing user-set vs default values during config merging; change
each field to Option<RestrictedRegex> (android_path_regex:
Option<RestrictedRegex>, ios_path_regex: Option<RestrictedRegex>) and update any
consumers (rule code that reads these fields) to use as_ref().map(|r| r) or
as_ref().unwrap_or(&default_pattern) / unwrap_or_else to fall back to the rule
defaults during evaluation so merging logic can detect unset vs explicitly
provided values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e5ac23c4-4290-4301-ab4c-f84b6c970b07

📥 Commits

Reviewing files that changed from the base of the PR and between f42405f and 1b30752.

⛔ Files ignored due to path filters (8)
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/invalid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/invalidWithOptions/invalid.jsx.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/valid.android.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/valid.ios.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/valid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/validWithOptions/valid.jsx.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (12)
  • .changeset/vast-phones-argue.md
  • crates/biome_js_analyze/src/lint/nursery/use_react_native_platform_components.rs
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/invalid.js
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/invalidWithOptions/invalid.jsx
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/invalidWithOptions/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/valid.android.js
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/valid.ios.js
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/valid.js
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/validWithOptions/valid.jsx
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/validWithOptions/valid.options.json
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_react_native_platform_components.rs

@github-actions github-actions Bot added A-CLI Area: CLI A-Project Area: project labels Apr 18, 2026
@codspeed-hq

codspeed-hq Bot commented Apr 18, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 59 untouched benchmarks
⏩ 195 skipped benchmarks1


Comparing feat/use-platform-components (3f32ff2) with main (92a909b)

Open in CodSpeed

Footnotes

  1. 195 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.

@ematipico

Copy link
Copy Markdown
Member Author

Wow, huge regression. Will look into it.

@dyc3 dyc3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My biggest concern is the options

Comment thread crates/biome_rule_options/src/use_react_native_platform_components.rs Outdated
Comment thread crates/biome_js_analyze/src/lint/nursery/use_react_native_platform_components.rs Outdated
Comment thread crates/biome_js_analyze/src/lint/nursery/use_react_native_platform_components.rs Outdated
Comment thread crates/biome_js_analyze/src/lint/nursery/use_react_native_platform_components.rs Outdated
@ematipico ematipico requested a review from dyc3 April 18, 2026 16:27
@ematipico ematipico force-pushed the feat/use-platform-components branch from 7490e01 to 6ebc2fd Compare April 18, 2026 16:29
@ematipico ematipico force-pushed the feat/use-platform-components branch from fc06750 to 7c7e8ca Compare April 19, 2026 15:19

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@crates/biome_js_analyze/src/lint/nursery/use_react_native_platform_components.rs`:
- Around line 59-65: The JSON examples in
use_react_native_platform_components.rs incorrectly wrap rule-specific settings
inside a nested "options" object; update the `json,options` code blocks (the
examples showing androidPathPatterns and iosPathPatterns) to remove the extra
"options" wrapper so the blocks contain the rule options directly (e.g., replace
{ "options": { "androidPathPatterns": [...] } } with { "androidPathPatterns":
[...] }) and make the same change for the second example referenced around the
other block.
- Around line 136-140: The is_ios_file check is incorrectly gated by
!is_android_file causing overlapping globs to hide iOS matches; change the logic
to compute Android and iOS matches independently by removing the
!is_android_file condition and evaluating
options.ios_path_patterns.as_ref().is_some_and(|patterns|
patterns.iter().any(|glob| glob.is_match(file_path))) directly (similar to how
is_android_file is computed), so both is_android_file and is_ios_file are set
based solely on their respective pattern checks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e824b4ba-7bd0-4c12-8d0e-1c112b8784a7

📥 Commits

Reviewing files that changed from the base of the PR and between 6ebc2fd and 7c7e8ca.

⛔ Files ignored due to path filters (13)
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs is excluded by !**/migrate/eslint_any_rule_to_biome.rs and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_configuration/src/generated/domain_selector.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_configuration/src/generated/linter_options_check.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/invalid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/invalidWithOptions/invalid.jsx.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/valid.android.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/valid.ios.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/valid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/validWithOptions/valid.jsx.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (12)
  • .changeset/vast-phones-argue.md
  • crates/biome_js_analyze/src/lint/nursery/use_react_native_platform_components.rs
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/invalid.js
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/invalidWithOptions/invalid.jsx
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/invalidWithOptions/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/valid.android.js
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/valid.ios.js
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/valid.js
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/validWithOptions/valid.jsx
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/validWithOptions/valid.options.json
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_react_native_platform_components.rs
✅ Files skipped from review due to trivial changes (9)
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/valid.ios.js
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/valid.android.js
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/invalid.js
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/validWithOptions/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/validWithOptions/valid.jsx
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/invalidWithOptions/invalid.options.json
  • .changeset/vast-phones-argue.md
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/valid.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_js_analyze/tests/specs/nursery/useReactNativePlatformComponents/invalidWithOptions/invalid.jsx

Comment thread crates/biome_js_analyze/src/lint/nursery/use_react_native_platform_components.rs Outdated

@dyc3 dyc3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

some possible areas that could've caused the perf regression. it could also be just evaluating globs so much.

Comment thread crates/biome_js_analyze/src/lint/nursery/use_react_native_platform_components.rs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
crates/biome_js_analyze/src/lint/nursery/use_react_native_platform_components.rs (2)

132-140: ⚠️ Potential issue | 🟠 Major

Match Android and iOS globs independently.

The !is_android_file guard means overlapping custom patterns can never count as iOS matches. If a file matches both globs, iOS-only imports are reported anyway, which is a bit too enthusiastic.

🐛 Minimal fix
-        let is_ios_file = !is_android_file
-            && options
-                .ios_path_patterns()
-                .iter()
-                .any(|glob| glob.is_match(file_path));
+        let is_ios_file = options
+            .ios_path_patterns()
+            .iter()
+            .any(|glob| glob.is_match(file_path));
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@crates/biome_js_analyze/src/lint/nursery/use_react_native_platform_components.rs`
around lines 132 - 140, The iOS match is incorrectly gated by !is_android_file
so overlapping custom globs never allow an iOS match; change the is_ios_file
computation to check ioS globs independently (call
options.ios_path_patterns().iter().any(|glob| glob.is_match(file_path)) without
the !is_android_file guard) so a file can be matched as both Android and iOS
when patterns overlap; update any logic that relied on the previous exclusivity
if necessary.

59-65: ⚠️ Potential issue | 🟡 Minor

Drop the extra "options" wrapper in these json,options examples.

These blocks are meant to show rule-local options, so the extra nesting is a tiny docs trap for the next person copying and pasting at speed.

📝 Suggested doc fix
 /// ```json,options
 /// {
-///     "options": {
-///         "androidPathPatterns": ["**/*.droid.jsx"]
-///     }
+///     "androidPathPatterns": ["**/*.droid.jsx"]
 /// }
 /// ```
@@
 /// ```json,options
 /// {
-///     "options": {
-///         "iosPathPatterns": ["**/*.apple.jsx"]
-///     }
+///     "iosPathPatterns": ["**/*.apple.jsx"]
 /// }
 /// ```

Based on learnings: Use options code block property for configuration option snippets containing only rule-specific options.

Also applies to: 83-89

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@crates/biome_js_analyze/src/lint/nursery/use_react_native_platform_components.rs`
around lines 59 - 65, In the doc comments inside
use_react_native_platform_components.rs, remove the extra "options" wrapper from
the json,options examples so the rule-local options are shown directly;
specifically update the example objects that currently contain "options": {
"androidPathPatterns": [...] } and "options": { "iosPathPatterns": [...] } to
instead be { "androidPathPatterns": [...] } and { "iosPathPatterns": [...] }
respectively (both example blocks in the file).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In
`@crates/biome_js_analyze/src/lint/nursery/use_react_native_platform_components.rs`:
- Around line 132-140: The iOS match is incorrectly gated by !is_android_file so
overlapping custom globs never allow an iOS match; change the is_ios_file
computation to check ioS globs independently (call
options.ios_path_patterns().iter().any(|glob| glob.is_match(file_path)) without
the !is_android_file guard) so a file can be matched as both Android and iOS
when patterns overlap; update any logic that relied on the previous exclusivity
if necessary.
- Around line 59-65: In the doc comments inside
use_react_native_platform_components.rs, remove the extra "options" wrapper from
the json,options examples so the rule-local options are shown directly;
specifically update the example objects that currently contain "options": {
"androidPathPatterns": [...] } and "options": { "iosPathPatterns": [...] } to
instead be { "androidPathPatterns": [...] } and { "iosPathPatterns": [...] }
respectively (both example blocks in the file).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ef18f534-9d4d-490d-88d5-9bb3e3a2b556

📥 Commits

Reviewing files that changed from the base of the PR and between 7c7e8ca and ade8d33.

⛔ Files ignored due to path filters (1)
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (2)
  • crates/biome_js_analyze/src/lint/nursery/use_react_native_platform_components.rs
  • crates/biome_rule_options/src/use_react_native_platform_components.rs

@ematipico ematipico merged commit 11ddc05 into main Apr 22, 2026
30 of 31 checks passed
@ematipico ematipico deleted the feat/use-platform-components branch April 22, 2026 07:32
@github-actions github-actions Bot mentioned this pull request Apr 21, 2026
OIRNOIR pushed a commit to OIRNOIR/YouTube-Helper-Server that referenced this pull request Apr 24, 2026
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [@biomejs/biome](https://biomejs.dev) ([source](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome)) | patch | `2.4.12` → `2.4.13` |

---

### Release Notes

<details>
<summary>biomejs/biome (@&#8203;biomejs/biome)</summary>

### [`v2.4.13`](https://github.com/biomejs/biome/blob/HEAD/packages/@&#8203;biomejs/biome/CHANGELOG.md#2413)

[Compare Source](https://github.com/biomejs/biome/compare/@biomejs/biome@2.4.12...@biomejs/biome@2.4.13)

##### Patch Changes

- [#&#8203;9969](biomejs/biome#9969) [`c5eb92b`](biomejs/biome@c5eb92b) Thanks [@&#8203;officialasishkumar](https://github.com/officialasishkumar)! - Added the nursery rule [`noUnnecessaryTemplateExpression`](https://biomejs.dev/linter/rules/no-unnecessary-template-expression/), which disallows template literals that only contain string literal expressions. These can be replaced with a simpler string literal.

  For example, the following code triggers the rule:

  ```js
  const a = `${"hello"}`; // can be 'hello'
  const b = `${"prefix"}_suffix`; // can be 'prefix_suffix'
  const c = `${"a"}${"b"}`; // can be 'ab'
  ```

- [#&#8203;10037](biomejs/biome#10037) [`f785e8c`](biomejs/biome@f785e8c) Thanks [@&#8203;minseong0324](https://github.com/minseong0324)! - Fixed [#&#8203;9810](biomejs/biome#9810): [`noMisleadingReturnType`](https://biomejs.dev/linter/rules/no-misleading-return-type/) no longer reports false positives on a getter with a matching setter in the same namespace.

  ```ts
  class Store {
    get status(): string {
      if (Math.random() > 0.5) return "loading";
      return "idle";
    }
    set status(v: string) {}
  }
  ```

- [#&#8203;10084](biomejs/biome#10084) [`5e2f90c`](biomejs/biome@5e2f90c) Thanks [@&#8203;jiwon79](https://github.com/jiwon79)! - Fixed [#&#8203;10034](biomejs/biome#10034): [`noUselessEscapeInRegex`](https://biomejs.dev/linter/rules/no-useless-escape-in-regex/) no longer flags escapes of `ClassSetReservedPunctuator` characters (`&`, `!`, `#`, `%`, `,`, `:`, `;`, `<`, `=`, `>`, `@`, `` ` ``, `~`) inside `v`-flag character classes as useless. These characters are reserved as individual code points in `v`-mode, so the escape is required.

  The following pattern is now considered valid:

  ```js
  /[a-z\&]/v;
  ```

- [#&#8203;10063](biomejs/biome#10063) [`c9ffa16`](biomejs/biome@c9ffa16) Thanks [@&#8203;Netail](https://github.com/Netail)! - Added extra rule sources from ESLint CSS. `biome migrate eslint` should do a bit better detecting rules in your eslint configurations.

- [#&#8203;10035](biomejs/biome#10035) [`946b50e`](biomejs/biome@946b50e) Thanks [@&#8203;Netail](https://github.com/Netail)! - Fixed [#&#8203;10032](biomejs/biome#10032): [useIframeSandbox](https://biomejs.dev/linter/rules/use-iframe-sandbox/) now flags if there's no initializer value.

- [#&#8203;9865](biomejs/biome#9865) [`68fb8d4`](biomejs/biome@68fb8d4) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added the new nursery rule [`useDomNodeTextContent`](https://biomejs.dev/linter/rules/use-dom-node-text-content/), which prefers `textContent` over `innerText` for DOM node text access and destructuring.

  For example, the following snippet triggers the rule:

  ```js
  const foo = node.innerText;
  ```

- [#&#8203;10023](biomejs/biome#10023) [`bd1e74f`](biomejs/biome@bd1e74f) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Added a new nursery rule [`noReactNativeDeepImports`](https://biomejs.dev/linter/rules/no-react-native-deep-imports/) that disallows deep imports from the `react-native` package. Internal paths like `react-native/Libraries/...` are not part of the public API and may change between versions.

  For example, the following code triggers the rule:

  ```js
  import View from "react-native/Libraries/Components/View/View";
  ```

- [#&#8203;9885](biomejs/biome#9885) [`3dce737`](biomejs/biome@3dce737) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added a new nursery rule [`useDomQuerySelector`](https://biomejs.dev/linter/rules/use-dom-query-selector/) that prefers `querySelector()` and `querySelectorAll()` over older DOM query methods such as `getElementById()` and `getElementsByClassName()`.

- [#&#8203;9995](biomejs/biome#9995) [`4da9caf`](biomejs/biome@4da9caf) Thanks [@&#8203;siketyan](https://github.com/siketyan)! - Fixed [#&#8203;9994](biomejs/biome#9994): Biome now parses nested CSS rules correctly when declarations follow them inside embedded snippets.

- [#&#8203;10009](biomejs/biome#10009) [`b41cc5a`](biomejs/biome@b41cc5a) Thanks [@&#8203;Jayllyz](https://github.com/Jayllyz)! - Fixed [#&#8203;10004](biomejs/biome#10004): [`noComponentHookFactories`](https://biomejs.dev/linter/rules/no-component-hook-factories/) no longer reports false positives for object methods and class methods.

- [#&#8203;9988](biomejs/biome#9988) [`eabf54a`](biomejs/biome@eabf54a) Thanks [@&#8203;Netail](https://github.com/Netail)! - Tweaked the diagnostics range for [useAltText](https://biomejs.dev/linter/rules/use-alt-text), [useButtonType](https://biomejs.dev/linter/rules/use-button-type), [useHtmlLang](https://biomejs.dev/linter/rules/use-html-lang), [useIframeTitle](https://biomejs.dev/linter/rules/use-iframe-title), [useValidAriaRole](https://biomejs.dev/linter/rules/use-valid-aria-role) & [useIfameSandbox](https://biomejs.dev/linter/rules/use-iframe-sandbox) to report on the opening tag instead of the full tag.

- [#&#8203;10043](biomejs/biome#10043) [`fc65902`](biomejs/biome@fc65902) Thanks [@&#8203;mujpao](https://github.com/mujpao)! - Fixed [#&#8203;10003](biomejs/biome#10003): Biome no longer panics when parsing Svelte files containing `{#}`.

- [#&#8203;9815](biomejs/biome#9815) [`5cc83b1`](biomejs/biome@5cc83b1) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added the new nursery rule [`noLoopFunc`](https://biomejs.dev/linter/rules/no-loop-func/). When enabled, it warns when a function declared inside a loop captures outer variables that can change across iterations.

- [#&#8203;9702](biomejs/biome#9702) [`ef470ba`](biomejs/biome@ef470ba) Thanks [@&#8203;ryan-m-walker](https://github.com/ryan-m-walker)! - Added the nursery rule [`useRegexpTest`](https://biomejs.dev/linter/rules/use-regexp-test/) that enforces `RegExp.prototype.test()` over `String.prototype.match()` and `RegExp.prototype.exec()` in boolean contexts. `test()` returns a boolean directly, avoiding unnecessary computation of match results.

  **Invalid**

  ```js
  if ("hello world".match(/hello/)) {
  }
  ```

  **Valid**

  ```js
  if (/hello/.test("hello world")) {
  }
  ```

- [#&#8203;9743](biomejs/biome#9743) [`245307d`](biomejs/biome@245307d) Thanks [@&#8203;leetdavid](https://github.com/leetdavid)! - Fixed [#&#8203;2245](biomejs/biome#2245): Svelte `<script>` tag language detection when the `generics` attribute contains `>` characters (e.g., `<script lang="ts" generics="T extends Record<string, unknown>">`). Biome now correctly recognizes TypeScript in such script blocks.

- [#&#8203;10046](biomejs/biome#10046) [`0707de7`](biomejs/biome@0707de7) Thanks [@&#8203;Conaclos](https://github.com/Conaclos)! - Fixed [#&#8203;10038](biomejs/biome#10038): [`organizeImports`](https://biomejs.dev/assist/actions/organize-imports/) now sorts imports in TypeScript modules and declaration files.

  ```diff
    declare module "mymodule" {
  -  	import type { B } from "b";
    	import type { A } from "a";
  +  	import type { B } from "b";
    }
  ```

- [#&#8203;10012](biomejs/biome#10012) [`94ccca9`](biomejs/biome@94ccca9) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Added the nursery rule [`noReactNativeLiteralColors`](https://biomejs.dev/linter/rules/no-react-native-literal-colors/), which disallows color literals inside React Native styles.

  The rule belongs to the `reactNative` domain. It reports properties whose name contains `color` and whose value is a string literal when they appear inside a `StyleSheet.create(...)` call or inside a JSX attribute whose name contains `style`.

  ```jsx
  // Invalid
  const Hello = () => <Text style={{ backgroundColor: "#FFFFFF" }}>hi</Text>;

  const styles = StyleSheet.create({
    text: { color: "red" },
  });
  ```

  ```jsx
  // Valid
  const red = "#f00";
  const styles = StyleSheet.create({
    text: { color: red },
  });
  ```

- [#&#8203;10005](biomejs/biome#10005) [`131019e`](biomejs/biome@131019e) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Added the nursery rule [`noReactNativeRawText`](https://biomejs.dev/linter/rules/no-react-native-raw-text/), which disallows raw text outside of `<Text>` components in React Native.

  The rule belongs to the new `reactNative` domain.

  ```jsx
  // Invalid
  <View>some text</View>
  <View>{'some text'}</View>
  ```

  ```jsx
  // Valid
  <View>
    <Text>some text</Text>
  </View>
  ```

  Additional components can be allowlisted through the `skip` option:

  ```json
  {
    "options": {
      "skip": ["Title"]
    }
  }
  ```

- [#&#8203;9911](biomejs/biome#9911) [`1603f78`](biomejs/biome@1603f78) Thanks [@&#8203;Netail](https://github.com/Netail)! - Added the nursery rule [`noJsxLeakedDollar`](https://biomejs.dev/linter/rules/no-jsx-leaked-dollar), which flags text nodes with a trailing `$` if the next sibling node is a JSX expression. This could be an unintentional mistake, resulting in a '$' being rendered as text in the output.

  **Invalid**:

  ```jsx
  function MyComponent({ user }) {
    return <div>Hello ${user.name}</div>;
  }
  ```

- [#&#8203;9999](biomejs/biome#9999) [`f42405f`](biomejs/biome@f42405f) Thanks [@&#8203;minseong0324](https://github.com/minseong0324)! - Fixed `noMisleadingReturnType` incorrectly flagging functions with reassigned `let` variables.

- [#&#8203;10075](biomejs/biome#10075) [`295f97f`](biomejs/biome@295f97f) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixed [`#9983`](biomejs/biome#9983): Biome now parses functions declared inside Svelte `#snippet` blocks without throwing errors.

- [#&#8203;10006](biomejs/biome#10006) [`cf4c1c9`](biomejs/biome@cf4c1c9) Thanks [@&#8203;minseong0324](https://github.com/minseong0324)! - Fixed [#&#8203;9810](biomejs/biome#9810): `noMisleadingReturnType` incorrectly flagging nested object literals with widened properties.

- [#&#8203;10033](biomejs/biome#10033) [`11ddc05`](biomejs/biome@11ddc05) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Added the nursery rule [`useReactNativePlatformComponents`](https://biomejs.dev/linter/rules/use-react-native-platform-components/) that ensures platform-specific React Native components (e.g. `ProgressBarAndroid`, `ActivityIndicatorIOS`) are only imported in files with a matching platform suffix. It also reports when Android and iOS components are mixed in the same file.

  The following code triggers the rule when the file does not have an `.android.js` suffix:

  ```js
  // file.js
  import { ProgressBarAndroid } from "react-native";
  ```

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMzkuNiIsInVwZGF0ZWRJblZlciI6IjQzLjEzOS42IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://git.oirnoir.dev/OIRNOIR/YouTube-Helper-Server/pulls/1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Diagnostic Area: diagnostocis A-Linter Area: linter A-Project Area: project L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants