Skip to content

feat: codegen and domains#3795

Merged
ematipico merged 1 commit intonextfrom
feat/fix-codegen-and-domains
Jan 5, 2026
Merged

feat: codegen and domains#3795
ematipico merged 1 commit intonextfrom
feat/fix-codegen-and-domains

Conversation

@ematipico
Copy link
Member

Summary

  • Updates next to the latest commit of the next branch of biomejs/biome
  • Updates the docs to document the newly Types domain

@ematipico ematipico requested review from a team January 5, 2026 09:56
@netlify
Copy link

netlify bot commented Jan 5, 2026

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit a7f03fe
🔍 Latest deploy log https://app.netlify.com/projects/biomejs/deploys/695b8aab15a72c0008c0a024
😎 Deploy Preview https://deploy-preview-3795--biomejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 5, 2026

Walkthrough

The pull request introduces a new Types domain for linter rules that require type inference capabilities, reclassifying seven rules from the project domain to the new types domain. Changes include updates to the codegen system to document the new domain, modifications to rule documentation pages to reflect the domain changes, updates to dependency revisions in Cargo.toml and package.json, and addition of a new useAltText rule for HTML with corresponding documentation.

Possibly related PRs

  • biomejs/website#3598: Modifies codegen/src/lintdoc.rs and Cargo.toml revisions with overlapping analyzer wiring changes
  • biomejs/website#3641: Updates linter documentation generation in codegen/src/lintdoc.rs with overlapping docs changes for rule pages

Suggested labels

A-Documentation

Suggested reviewers

  • dyc3

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: codegen and domains' accurately reflects the primary changes: updating codegen logic and introducing the new Types domain documentation.
Description check ✅ Passed The description clearly relates to the changeset, covering both the dependency updates and the documentation changes for the new Types domain.
✨ 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: 4

Fix all issues with AI Agents 🤖
In @codegen/src/domains.rs:
- Around line 126-132: In the RuleDomain::Types documentation string (the
writeln! call that writes "This domain contains rules..."), replace the
incorrect phrase "resolve and flat types" with "resolve and flatten types" so
the sentence reads "and it will enable the inference engine to resolve and
flatten types"; update the string literal inside the writeln! invocation
accordingly.

In @src/content/docs/linter/domains.mdx:
- Line 350: The generated sentence contains a grammar bug: the phrase "resolve
and flat types" should be changed to "resolve and flatten types" (or "resolve
and infer types"); update the template or string in the code generator that
emits the domain description by replacing the literal "resolve and flat types"
with "resolve and flatten types" (locate the generator entry that produces the
sentence—the template/constant that includes "This domain contains rules that
perform project-level analysis" in your codegen module, e.g., the domains.rs
generator function or template) so regenerated docs include the corrected
wording.

In @src/content/docs/linter/rules/use-iterable-callback-return.mdx:
- Around line 106-108: Fix the malformed markdown marker `**Since \`v2.4.0**` by
either removing the stray backticks or properly escaping/closing them; replace
it with a valid marker such as `**Since v2.4.0**` or `Since \`v2.4.0\`` so the
bolding and code formatting render correctly in the
`use-iterable-callback-return` rule docs.
- Line 137: The documentation has a conflicting default for the checkForEach
option: update the sentence that reads "When `checkForEach` is `false`
(default)" so it matches the declared default `true` (line that shows "Default:
`true`"); specifically change the wording to "When `checkForEach` is `true`
(default)" or equivalent so both the example and the documented Default for the
`checkForEach` option are consistent.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c428052 and a7f03fe.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (23)
  • Cargo.toml
  • codegen/src/domains.rs
  • codegen/src/lintdoc.rs
  • package.json
  • src/content/docs/linter/domains.mdx
  • src/content/docs/linter/html/rules.mdx
  • src/content/docs/linter/rules/no-deprecated-imports.mdx
  • src/content/docs/linter/rules/no-floating-promises.mdx
  • src/content/docs/linter/rules/no-import-cycles.mdx
  • src/content/docs/linter/rules/no-misused-promises.mdx
  • src/content/docs/linter/rules/no-private-imports.mdx
  • src/content/docs/linter/rules/no-undeclared-dependencies.mdx
  • src/content/docs/linter/rules/no-unnecessary-conditions.mdx
  • src/content/docs/linter/rules/no-unresolved-imports.mdx
  • src/content/docs/linter/rules/use-alt-text.mdx
  • src/content/docs/linter/rules/use-array-sort-compare.mdx
  • src/content/docs/linter/rules/use-await-thenable.mdx
  • src/content/docs/linter/rules/use-exhaustive-switch-cases.mdx
  • src/content/docs/linter/rules/use-find.mdx
  • src/content/docs/linter/rules/use-import-extensions.mdx
  • src/content/docs/linter/rules/use-iterable-callback-return.mdx
  • src/content/docs/linter/rules/use-json-import-attributes.mdx
  • src/content/docs/linter/rules/use-regexp-exec.mdx
🧰 Additional context used
🪛 LanguageTool
src/content/docs/linter/domains.mdx

[duplication] ~386-~386: Possible typo: you repeated a word.
Context: ... "types": "none" } } } ``` ### Types rules Rules that belong to the domain: - [noFloatin...

(ENGLISH_WORD_REPEAT_RULE)

src/content/docs/linter/rules/use-alt-text.mdx

[style] ~115-~115: ‘in order for them to’ might be wordy. Consider a shorter alternative.
Context: ...f accessibility for screen reader users in order for them to understand the content's purpose on the...

(EN_WORDINESS_PREMIUM_IN_ORDER_FOR_THEM_TO)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Redirect rules - biomejs
  • GitHub Check: Header rules - biomejs
  • GitHub Check: Pages changed - biomejs
  • GitHub Check: test
🔇 Additional comments (22)
src/content/docs/linter/rules/no-misused-promises.mdx (1)

16-24: Domain references confirmed—all links valid.

The reclassification to the types domain is consistent across both lines 16 and 24, and the target documentation at /linter/domains#types exists with the proper anchor.

src/content/docs/linter/rules/no-unnecessary-conditions.mdx (1)

16-16: Domain migration to types looks spot on.

The documentation correctly reflects that this rule now belongs to the types domain, with both the note and summary consistently updated. The explanation about enabling the type inference engine is clear and appropriate.

Also applies to: 24-24

src/content/docs/linter/rules/no-unresolved-imports.mdx (1)

16-16: Clarification improves documentation.

The updated wording makes it explicit that activating the Biome Scanner will scan project files, which helps users understand the impact.

src/content/docs/linter/rules/no-import-cycles.mdx (1)

16-16: Documentation clarification approved.

The enhanced note text appropriately describes the scanner's behaviour for project domain rules.

src/content/docs/linter/rules/no-deprecated-imports.mdx (1)

16-16: Wording improvement looks good.

The clarification maintains consistency with other project domain rules whilst making the scanner's behaviour more explicit.

src/content/docs/linter/rules/no-private-imports.mdx (1)

13-13: Documentation update approved.

The enhanced note is consistent with the updates across other project domain rules, providing clearer guidance about scanner activation.

src/content/docs/linter/rules/no-undeclared-dependencies.mdx (1)

13-13: Improved clarity on scanner activation.

The updated wording is more explicit about what activating the project domain actually does, which is helpful for users.

src/content/docs/linter/rules/use-await-thenable.mdx (1)

16-16: Correct domain reclassification to Types.

This rule requires type inference to determine whether a value is a Promise, so the move to the types domain is appropriate. The updated documentation clearly explains that activating this rule enables the type inference engine.

Also applies to: 24-24

src/content/docs/linter/rules/use-regexp-exec.mdx (1)

16-16: Appropriate domain reclassification to Types.

This rule requires type inference to identify String#match calls on regex patterns without the global flag, so the types domain is the correct classification.

Also applies to: 24-24

src/content/docs/linter/rules/use-json-import-attributes.mdx (1)

13-13: Improved documentation clarity.

The updated description is more explicit about scanner activation, consistent with the project domain documentation updates across the codebase.

package.json (1)

37-37: Dependencies properly aligned. Commit adcce82eaede7d2db2ef95f27a6109b2475595b5 is consistently referenced across package.json and Cargo.toml, and Types domain support is documented throughout the codebase.

codegen/src/lintdoc.rs (2)

732-749: Types domain prioritisation logic looks correct.

The implementation correctly prioritises the Types domain over Project domain when generating the documentation note. This ensures rules belonging to both domains show the more specific Types domain information.


1854-1854: HTML analyze API updated with file_source parameter.

This aligns with the upstream API change in biome_html_analyze::analyze. Ensure this parameter is required by the new revision.

src/content/docs/linter/rules/use-import-extensions.mdx (1)

12-14: Documentation note updated for project domain.

The updated wording correctly describes the Biome Scanner activation for project-domain rules without mentioning type inference (which is specific to the Types domain).

src/content/docs/linter/rules/use-array-sort-compare.mdx (1)

15-24: Rule reclassified to Types domain.

The documentation correctly reflects the rule's new domain classification, including the updated note about type inference engine activation.

src/content/docs/linter/rules/use-find.mdx (1)

15-24: Rule reclassified to Types domain.

Consistent with the other rule updates in this PR. The documentation correctly reflects the types domain classification.

Cargo.toml (1)

19-62: Dependency revision bump is consistent and valid.

All biome crates updated to the same revision adcce82eaede7d2db2ef95f27a6109b2475595b5 (feat: types domain and optional inference). Aligns perfectly with the PR objective.

src/content/docs/linter/rules/no-floating-promises.mdx (1)

16-16: LGTM! Domain reclassification looks correct.

The rule has been properly moved to the types domain, and the updated description clearly explains the type inference engine activation.

Also applies to: 24-24

src/content/docs/linter/html/rules.mdx (1)

28-28: LGTM! New rule entry added correctly.

The useAltText rule has been properly added to both the rules table and the recommended rules list with appropriate formatting and icons.

Also applies to: 66-66

src/content/docs/linter/rules/use-exhaustive-switch-cases.mdx (1)

16-16: LGTM! Consistent domain reclassification.

Domain change matches the pattern applied to other type-inference rules.

Also applies to: 24-24

src/content/docs/linter/rules/use-alt-text.mdx (1)

86-198: LGTM! Comprehensive HTML documentation added.

The new HTML tab is well-structured and includes a helpful note about case-sensitivity differences between HTML and component frameworks (lines 121-125).

src/content/docs/linter/domains.mdx (1)

349-395: New Types domain section looks good otherwise.

The Types domain documentation follows the established pattern and clearly explains the type inference engine activation. The rules list is comprehensive.

Comment on lines +126 to +132
RuleDomain::Types => {
writeln!(buffer, "## {name}")?;
writeln!(
buffer,
"This domain contains rules that perform project-level analysis. This includes our module graph for dependency resolution. When enabling rules that belong to this domain, Biome will scan the entire project, *and it will enable the inference engine to resolve and flat types*. The scanning phase will have a performance impact on the linting process. See the documentation on our [scanner](/internals/architecture/#scanner) to learn more about the scanner."
)?;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor wording issue: "flat types" should likely be "flatten types"

The phrase "resolve and flat types" on line 130 appears grammatically incorrect. Consider "resolve and flatten types" instead.

🔎 Proposed fix
                 RuleDomain::Types => {
                     writeln!(buffer, "## {name}")?;
                     writeln!(
                         buffer,
-                        "This domain contains rules that perform project-level analysis. This includes our module graph for dependency resolution. When enabling rules that belong to this domain, Biome will scan the entire project, *and it will enable the inference engine to resolve and flat types*. The scanning phase will have a performance impact on the linting process. See the documentation on our [scanner](/internals/architecture/#scanner) to learn more about the scanner."
+                        "This domain contains rules that perform project-level analysis. This includes our module graph for dependency resolution. When enabling rules that belong to this domain, Biome will scan the entire project, *and it will enable the inference engine to resolve and flatten types*. The scanning phase will have a performance impact on the linting process. See the documentation on our [scanner](/internals/architecture/#scanner) to learn more about the scanner."
                     )?;
                 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
RuleDomain::Types => {
writeln!(buffer, "## {name}")?;
writeln!(
buffer,
"This domain contains rules that perform project-level analysis. This includes our module graph for dependency resolution. When enabling rules that belong to this domain, Biome will scan the entire project, *and it will enable the inference engine to resolve and flat types*. The scanning phase will have a performance impact on the linting process. See the documentation on our [scanner](/internals/architecture/#scanner) to learn more about the scanner."
)?;
}
RuleDomain::Types => {
writeln!(buffer, "## {name}")?;
writeln!(
buffer,
"This domain contains rules that perform project-level analysis. This includes our module graph for dependency resolution. When enabling rules that belong to this domain, Biome will scan the entire project, *and it will enable the inference engine to resolve and flatten types*. The scanning phase will have a performance impact on the linting process. See the documentation on our [scanner](/internals/architecture/#scanner) to learn more about the scanner."
)?;
}
🤖 Prompt for AI Agents
In @codegen/src/domains.rs around lines 126-132, In the RuleDomain::Types
documentation string (the writeln! call that writes "This domain contains
rules..."), replace the incorrect phrase "resolve and flat types" with "resolve
and flatten types" so the sentence reads "and it will enable the inference
engine to resolve and flatten types"; update the string literal inside the
writeln! invocation accordingly.

Rules that belong to the domain:
- [noUndeclaredEnvVars](/linter/rules/no-undeclared-env-vars) [(nursery)](/linter/#nursery)
## Types
This domain contains rules that perform project-level analysis. This includes our module graph for dependency resolution. When enabling rules that belong to this domain, Biome will scan the entire project, *and it will enable the inference engine to resolve and flat types*. The scanning phase will have a performance impact on the linting process. See the documentation on our [scanner](/internals/architecture/#scanner) to learn more about the scanner.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Grammar issue: "flat types" should be "flatten types".

The phrase "resolve and flat types" contains a grammar error. It should read "resolve and flatten types" or "resolve and infer types".

Since this file is auto-generated, the fix needs to be applied in the source code at biomejs/biome repository, likely in src/codegen/src/domains.rs.

🤖 Prompt for AI Agents
In @src/content/docs/linter/domains.mdx around line 350, The generated sentence
contains a grammar bug: the phrase "resolve and flat types" should be changed to
"resolve and flatten types" (or "resolve and infer types"); update the template
or string in the code generator that emits the domain description by replacing
the literal "resolve and flat types" with "resolve and flatten types" (locate
the generator entry that produces the sentence—the template/constant that
includes "This domain contains rules that perform project-level analysis" in
your codegen module, e.g., the domains.rs generator function or template) so
regenerated docs include the corrected wording.

Comment on lines +106 to +108
**Since \`v2.4.0**

Default: `true`
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Typo in "Since" version marker.

Line 106 has malformed markdown: **Since \v2.4.0**should likely beSince v2.4.0orSince `v2.4.0``.

🤖 Prompt for AI Agents
In @src/content/docs/linter/rules/use-iterable-callback-return.mdx around lines
106-108, Fix the malformed markdown marker `**Since \`v2.4.0**` by either
removing the stray backticks or properly escaping/closing them; replace it with
a valid marker such as `**Since v2.4.0**` or `Since \`v2.4.0\`` so the bolding
and code formatting render correctly in the `use-iterable-callback-return` rule
docs.

});
```

When `checkForEach` is `false` (default), the above code will not trigger any diagnostic.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Contradictory default value.

Line 108 states Default: \true`, but line 137 states "When checkForEachisfalse(default)". One of these is incorrect. Given the context (skipping forEach callbacks that return a value when false), the default should likely betrue` to enforce the check.

🔎 Proposed fix
-When `checkForEach` is `false` (default), the above code will not trigger any diagnostic.
+When `checkForEach` is `false`, the above code will not trigger any diagnostic.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
When `checkForEach` is `false` (default), the above code will not trigger any diagnostic.
When `checkForEach` is `false`, the above code will not trigger any diagnostic.
🤖 Prompt for AI Agents
In @src/content/docs/linter/rules/use-iterable-callback-return.mdx around line
137, The documentation has a conflicting default for the checkForEach option:
update the sentence that reads "When `checkForEach` is `false` (default)" so it
matches the declared default `true` (line that shows "Default: `true`");
specifically change the wording to "When `checkForEach` is `true` (default)" or
equivalent so both the example and the documented Default for the `checkForEach`
option are consistent.

@ematipico ematipico merged commit ef0b84a into next Jan 5, 2026
8 checks passed
@ematipico ematipico deleted the feat/fix-codegen-and-domains branch January 5, 2026 13:57
This was referenced Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants