Conversation
✅ Deploy Preview for biomejs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughThe pull request introduces a new Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
Comment |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (2)
Cargo.lockis excluded by!**/*.lockpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (23)
Cargo.tomlcodegen/src/domains.rscodegen/src/lintdoc.rspackage.jsonsrc/content/docs/linter/domains.mdxsrc/content/docs/linter/html/rules.mdxsrc/content/docs/linter/rules/no-deprecated-imports.mdxsrc/content/docs/linter/rules/no-floating-promises.mdxsrc/content/docs/linter/rules/no-import-cycles.mdxsrc/content/docs/linter/rules/no-misused-promises.mdxsrc/content/docs/linter/rules/no-private-imports.mdxsrc/content/docs/linter/rules/no-undeclared-dependencies.mdxsrc/content/docs/linter/rules/no-unnecessary-conditions.mdxsrc/content/docs/linter/rules/no-unresolved-imports.mdxsrc/content/docs/linter/rules/use-alt-text.mdxsrc/content/docs/linter/rules/use-array-sort-compare.mdxsrc/content/docs/linter/rules/use-await-thenable.mdxsrc/content/docs/linter/rules/use-exhaustive-switch-cases.mdxsrc/content/docs/linter/rules/use-find.mdxsrc/content/docs/linter/rules/use-import-extensions.mdxsrc/content/docs/linter/rules/use-iterable-callback-return.mdxsrc/content/docs/linter/rules/use-json-import-attributes.mdxsrc/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
typesdomain is consistent across both lines 16 and 24, and the target documentation at/linter/domains#typesexists 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. Commitadcce82eaede7d2db2ef95f27a6109b2475595b5is 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
typesdomain, 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
useAltTextrule 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.
| 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." | ||
| )?; | ||
| } |
There was a problem hiding this comment.
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.
| 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. |
There was a problem hiding this comment.
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.
| **Since \`v2.4.0** | ||
|
|
||
| Default: `true` |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
| 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.
Summary
nextto the latest commit of thenextbranch ofbiomejs/biomeTypesdomain