+
Skip to content

Conversation

ematipico
Copy link
Member

Summary

This PR adds new rules exclusive to Biome. Please review the changesets to understand their purpose.

I want to make these lint rules stable for v2.2, hence breaking our non-written rule regarding the stabilisation of lint rules. useBiomeIgnoreFolder is very important for the upcoming v2.2, because it will speed up some projects where the crawling affected the performance.

As for noBiomeFirstException, there have been many cases where users incorrectly used the patterns. I thought a rule could catch these cases early.

Please let me know what you think @biomejs/core-contributors and @biomejs/maintainers

Test Plan

Added new tests

Docs

Added in this PR

Copy link

changeset-bot bot commented Aug 8, 2025

🦋 Changeset detected

Latest commit: a6a9012

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

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

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

@ematipico ematipico changed the title feat(lint): add two new rules feat(lint): add useBiomeIgnoreFolder and noBiomeFirstException Aug 8, 2025
@github-actions github-actions bot added A-Project Area: project A-Linter Area: linter L-JSON Language: JSON and super languages A-Diagnostic Area: diagnostocis labels Aug 8, 2025
@ematipico ematipico requested review from a team August 8, 2025 17:02
Copy link
Contributor

coderabbitai bot commented Aug 8, 2025

Walkthrough

  • Introduces two new lint rules: noBiomeFirstException and useBiomeIgnoreFolder, placed in the Nursery group.
  • Updates rule enums, group wiring, enable/disable resolution, and configuration retrieval.
  • Adds rule options modules and corresponding backend JSON-RPC typings and configuration schema entries.
  • Updates diagnostics category mappings to include the new rules under lint/suspicious.
  • Adds a utility function matches_parent_object in biome_json_analyze.
  • Adjusts biome.json includes patterns (removes trailing slashes for folder ignores).
  • Moves UseNamingConvention from Nursery to Style.
  • Adds test fixtures for both new rules (valid/invalid cases, including overrides).

Possibly related PRs

  • feat: promote rules #7137 — Also adjusts lint rule groupings and diagnostics categories, including moving UseNamingConvention from Nursery to Style.

Suggested reviewers

  • dyc3
  • arendjr
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/use-ignore-folder

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 9

🧹 Nitpick comments (12)
crates/biome_json_analyze/src/utils.rs (1)

50-51: Doc nit: grammar and formatting

Tweak wording and code-style markers.

-/// Finds the first ancestor [JsonMember], and returns [true] if it's name matches the given input
+/// Finds the first ancestor [JsonMember] and returns `true` if its name matches the given input
.changeset/floppy-sloths-visit.md (1)

7-8: Finish the sentence with a full stop.

Guidelines require every sentence in a changeset to end with a period; swap the trailing colon for “.”.

.changeset/proud-olives-exist.md (1)

7-8: Replace the trailing colon with a period.

Keeps the prose compliant with the changelog rules.

crates/biome_rule_options/src/use_biome_ignore_folder.rs (1)

3-6: Consider a unit struct

With no fields you can drop Default + serde boilerplate:

-#[derive(Default, Clone, Debug, Deserialize, Deserializable, Eq, PartialEq, Serialize)]
-pub struct UseBiomeIgnoreFolderOptions {}
+#[derive(Clone, Debug, Deserializable, Eq, PartialEq)]
+pub struct UseBiomeIgnoreFolderOptions;

Smaller binary and zero-cost.

crates/biome_json_analyze/src/lint/nursery/use_biome_ignore_folder.rs (2)

42-49: Missing ## Options section

Contribution guide demands an ## Options doc block – even if empty – under the rustdoc. Please add it.


108-114: Diagnostic copy-text typo

“use the trailing /**” → “use the trailing /**” is duplicated word the.

crates/biome_json_analyze/src/lint/nursery/no_biome_first_exception.rs (4)

108-114: Sharpen diagnostic wording

Make the message explicit about “includes” and why it fails.

-                    "Incorrect usage of the exception detected."
+                    "Do not start `files.includes` with a negation pattern (`!`)."
@@
-                    "Having a pattern that starts with `!` as first item will cause Biome to match no files."
+                    "If the first `includes` pattern starts with `!`, Biome will match no files."

140-141: Typo in fix description

Spotted “patter”; should be “pattern”.

-                "Add the patter "<Emphasis>"**"</Emphasis>" at the beginning of the list."
+                "Add the pattern "<Emphasis>"**"</Emphasis>" at the beginning of the list."

14-41: Doc polish: code fences and missing Options section

  • Invalid example should use expect_diagnostic per CONTRIBUTING.
  • Use jsonc fences for config examples.
  • Add an “Options” section (even if none).
-    /// ### Invalid
+    /// ### Invalid
@@
-    /// ```json,ignore
+    /// ```jsonc,expect_diagnostic
@@
-    /// ### Valid
+    /// ### Valid
@@
-    /// ```json,ignore
+    /// ```jsonc
@@
-    /// ```
+    /// ```
+    ///
+    /// ## Options
+    ///
+    /// This rule has no options.

121-135: Autofix rebuilds separators; may drop trivia

Rebuilding the entire element list with freshly minted separators can drop existing separator trivia (e.g. comments/spacing). If preserving trivia is important, prefer a “prepend one element” mutation API (insert a new element at index 0), reusing existing separators. If that API isn’t available here, current approach is acceptable for a Safe fix.

Happy to sketch a version using insert-before if desired.

packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)

1706-1709: Replace placeholder JSDoc with a meaningful summary

Document what the rule enforces so clients surface helpful help text.

Apply:

-	/**
-	 * Succinct description of the rule.
-	 */
+	/**
+	 * Enforce folder ignore patterns in Biome configs without trailing slashes or globstars
+	 * (prefer "dist" over "dist/" or "dist/**").
+	 */
crates/biome_configuration/src/analyzer/linter/rules.rs (1)

4388-4399: Fragile hard-coded indices in *_RULES_AS_FILTERS

Adding two rules shifted every index, forcing a manual update. Future edits are error-prone.

Consider generating these filter arrays programmatically:

const RECOMMENDED_RULES_AS_FILTERS: &[RuleFilter<'static>] = &[
    // derive with `enumerate()` over an inline list of names
];

This removes the need to juggle magic numbers.

Also applies to: 4461-4466

Comment on lines 1106 to 1107
Self::UseNamingConvention => RuleGroup::Style,
Self::UseNodeAssertStrict => RuleGroup::Style,
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

UseNamingConvention still listed under Nursery

The rule is now mapped to RuleGroup::Style, yet it remains in Nursery::GROUP_RULES and the derived index tables.
This inconsistency will cause filters & CLI group queries to mis-report the rule’s group.

Delete the entry from GROUP_RULES (and adjust subsequent index arithmetic) or move it to the Style group constant.

Also applies to: 4321-4325, 4461-4466

🤖 Prompt for AI Agents
In crates/biome_configuration/src/analyzer/linter/rules.rs around lines
1106-1107 and also at lines 4321-4325 and 4461-4466, the rule
UseNamingConvention is mapped to RuleGroup::Style but still listed under
Nursery::GROUP_RULES and related index tables. To fix this, remove
UseNamingConvention from the Nursery::GROUP_RULES array and adjust any index
calculations accordingly, or alternatively move it to the Style group constant
to maintain consistency between the mapping and group listings.

Comment on lines 6 to 9
pub mod no_biome_first_exception;
pub mod no_quickfix_biome;
declare_lint_group! { pub Nursery { name : "nursery" , rules : [self :: no_quickfix_biome :: NoQuickfixBiome ,] } }
pub mod use_biome_ignore_folder;
declare_lint_group! { pub Nursery { name : "nursery" , rules : [self :: no_biome_first_exception :: NoBiomeFirstException , self :: no_quickfix_biome :: NoQuickfixBiome , self :: use_biome_ignore_folder :: UseBiomeIgnoreFolder ,] } }
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

Broken mod path

pub mod no_biome_first_exception; won’t resolve while the file is named no_biome_first_expection.rs. Align them.

🤖 Prompt for AI Agents
In crates/biome_json_analyze/src/lint/nursery.rs around lines 6 to 9, the module
declaration `pub mod no_biome_first_exception;` does not match the filename
`no_biome_first_expection.rs`. Rename the file to `no_biome_first_exception.rs`
to align with the module path or update the module declaration to match the
existing filename, ensuring the module path resolves correctly.

Copy link
Member

Choose a reason for hiding this comment

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

Can we disable suggestions for these auto-generated files?

Copy link
Member Author

Choose a reason for hiding this comment

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

I couldn't find a setting to ignore certain files

Copy link

codspeed-hq bot commented Aug 8, 2025

CodSpeed Performance Report

Merging #7159 will not alter performance

Comparing feat/use-ignore-folder (a6a9012) with next (a653a0f)

Summary

✅ 128 untouched benchmarks

…ption.rs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

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

I'm not sure that it makes sense for these to be rules, because they can end up disabled by the user.

For things about biome that are wrong, we usually just emit diagnostics, right? Though if we did that, we'd lose the code actions.

@ematipico
Copy link
Member Author

ematipico commented Aug 9, 2025

I'm not sure that it makes sense for these to be rules, because they can end up disabled by the user.

For things about biome that are wrong, we usually just emit diagnostics, right? Though if we did that, we'd lose the code actions.

Yeah my thoughts exactly. However there's nothing wrong with Biome, it's just misconfiguration caused by the user.

A diagnostic during the deserialization could catch possible extended configurations, but we won't have the code actions.

Another alternative, make these rules as Syntax rules, and enable them specifically only when pulling diagnostics for configuration files: users can't turn them off

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: 0

♻️ Duplicate comments (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)

7989-7990: Optionless rules use = null; avoid {} for consistency and schema compatibility

Neighbouring rules (e.g. UseAnchorHrefOptions) use = null. Using {} alters the schema surface and can trip consumers.

Regenerate from sources to emit null:

-export interface UseBiomeIgnoreFolderOptions {}
+export type UseBiomeIgnoreFolderOptions = null;

Note: don’t hand-edit this file; fix the Rust options type so codegen produces null.


7914-7914: Replace empty interface with a null type for optionless rules

The nearby UseAnchorHrefOptions is declared as export type UseAnchorHrefOptions = null;, so we should mirror that pattern here to keep the JSON schema stable.

• packages/@biomejs/backend-jsonrpc/src/workspace.ts:7914

-export interface NoBiomeFirstExceptionOptions {}
+export type NoBiomeFirstExceptionOptions = null;

Please update the codegen/source schema to emit = null for optionless rules.

🧹 Nitpick comments (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)

1558-1561: Add rule entry: noBiomeFirstException — LGTM

Wiring and docs look good. Please ensure the rule only runs for Biome config files to avoid noise elsewhere (it sounds like you already do).

Given the discussion: if enforceability is key, consider making this a Syntax/Configuration diagnostic while still exposing a code action when diagnostics are pulled for config files. Happy to sketch that path if useful.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94fca30 and bc0e9c1.

📒 Files selected for processing (3)
  • crates/biome_configuration/src/analyzer/linter/rules.rs (19 hunks)
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts (11 hunks)
  • packages/@biomejs/biome/configuration_schema.json (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • packages/@biomejs/biome/configuration_schema.json
🧰 Additional context used
🧠 Learnings (33)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: You are encouraged to split the work for a new rule into multiple PRs and describe your plan in an issue if unfamiliar with Biome's APIs.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : If a lint rule is ported from another ecosystem (e.g., ESLint), add a `sources` metadata field in `declare_lint_rule!` referencing the original rule.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : New rules must be placed inside the `nursery` group for incubation before promotion.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : If a rule provides a code action, add the `fix_kind` metadata to the `declare_lint_rule!` macro and implement the `action` function.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Update the `language` field in `declare_lint_rule!` to match the language the rule applies to (e.g., `js`, `jsx`, `ts`, `tsx`).
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Rule documentation must start with a single-line summary, followed by detailed paragraphs, and include `## Examples` with `### Invalid` and `### Valid` sections.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Set the `severity` field in `declare_lint_rule!` to `Severity::Warning` or `Severity::Error` as appropriate for the rule.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When deprecating a rule, specify the reason using the `deprecated:` field in the `declare_lint_rule!` macro.
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: Applies to crates/biome_lint_rules/**/*.rs : Linter rules must have a `version` metadata field in their implementation, set to "next" for new rules and updated to the new version when releasing.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Rule options must be documented in the `## Options` section of the rule's documentation, with each option having its own header and example.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `version` field in `declare_lint_rule!` must be set to `next` for new rules.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `declare_lint_rule!` macro must be used to declare an analyzer rule type and implement the RuleMeta trait.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Assign the `domains` field in `declare_lint_rule!` if the rule belongs to a specific domain (e.g., testing, framework).
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Update the `language` field in `declare_lint_rule!` to match the language the rule applies to (e.g., `js`, `jsx`, `ts`, `tsx`).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : If a lint rule is ported from another ecosystem (e.g., ESLint), add a `sources` metadata field in `declare_lint_rule!` referencing the original rule.

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : New rules must be placed inside the `nursery` group for incubation before promotion.

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : If a rule provides a code action, add the `fix_kind` metadata to the `declare_lint_rule!` macro and implement the `action` function.

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `version` field in `declare_lint_rule!` must be set to `next` for new rules.

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Rule documentation must start with a single-line summary, followed by detailed paragraphs, and include `## Examples` with `### Invalid` and `### Valid` sections.

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When deprecating a rule, specify the reason using the `deprecated:` field in the `declare_lint_rule!` macro.

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Rule options must be documented in the `## Options` section of the rule's documentation, with each option having its own header and example.

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Assign the `domains` field in `declare_lint_rule!` if the rule belongs to a specific domain (e.g., testing, framework).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Set the `severity` field in `declare_lint_rule!` to `Severity::Warning` or `Severity::Error` as appropriate for the rule.

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/{use*,no*}_*{vue,react,angular,svelte}*.rs : If a rule overwhelmingly applies to a specific framework, it should be named using the `use<Framework>...` or `no<Framework>...` pattern (e.g., `noVueReservedProps`).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_empty*_*.rs : Rules that report empty code constructs should use the `noEmpty<Concept>` naming convention (e.g., `noEmptyBlockStatements`).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_useless*_*.rs : Rules that report unnecessary code should use the `noUseless<Concept>` naming convention (e.g., `noUselessConstructor`).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/*.rs : Rule options must be placed inside the `biome_rule_options` crate, with a file named after the rule (e.g., `use_this_convention.rs`).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
PR: biomejs/biome#7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/use_consistent*_*.rs : Rules that ensure consistency should use the `useConsistent<Concept>` naming convention (e.g., `useConsistentArrayType`).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_unused*_*.rs : Rules that report unused entities should use the `noUnused<Concept>` naming convention (e.g., `noUnusedVariables`).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/{no_invalid*,use_valid*}_*.rs : Rules that report invalid code should use the `noInvalid<Concept>` or `useValid<Concept>` naming conventions (e.g., `noInvalidConstructorSuper`, `useValidTypeof`).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no*_*.rs : Rules that forbid a single concept should be named using the `no<Concept>` prefix (e.g., `noDebugger` for disallowing `debugger` statements).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_unsafe*_*.rs : Rules that report unsafe code should use the `noUnsafe<Concept>` naming convention (e.g., `noUnsafeOptionalChaining`).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_restricted*_*.rs : Rules that report restricted entities should use the `noRestricted<Concept>` naming convention (e.g., `noRestrictedGlobals`).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/use*_*.rs : Rules that mandate a single concept should be named using the `use<Concept>` prefix (e.g., `useValidLang` for mandating valid HTML `lang` attribute values).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/use_shorthand*_*.rs : Rules that promote shorthand syntax should use the `useShorthand<Concept>` naming convention (e.g., `useShorthandAssign`).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_redundant*_*.rs : Rules that report redundant code should use the `noRedundant<Concept>` naming convention (e.g., `noRedundantUseStrict`).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_unknown*_*.rs : Rules that report unknown entities (e.g., CSS units) should use the `noUnknown<Concept>` naming convention (e.g., `noUnknownUnit`).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/*.rs : Rule option structs must derive `Deserializable`, `Serialize`, `Deserialize`, and (optionally) `JsonSchema` for configuration and schema support.

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Document and test the effect of rule options as part of the rule's documentation and test suite.

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/specs/html/**/options.json : If you require non-default formatting options for tests, create an `options.json` file in the same folder as the `.html` files. These options will apply to all files in that folder.

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Avoid deep indentation by using combinators like `map`, `filter`, and `and_then` instead of nested `if let` or `match` statements.

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_misleading*_*.rs : Rules that report misleading code should use the `noMisleading<Concept>` naming convention (e.g., `noMisleadingCharacterClass`).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When banning certain functions or variables, always check if the variable is global using the semantic model to avoid false positives.

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_undeclared*_*.rs : Rules that report undeclared entities should use the `noUndeclared<Concept>` naming convention (e.g., `noUndeclaredVariables`).

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
⏰ 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). (26)
  • GitHub Check: Test Node.js API
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: End-to-end tests
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_html_formatter)
  • GitHub Check: Bench (biome_html_parser)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_package)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Check JS Files
  • GitHub Check: autofix
🔇 Additional comments (6)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (6)

1710-1713: Add rule entry: useBiomeIgnoreFolder — LGTM

Nicely documented and placed in Nursery.


2906-2909: Type union for NoBiomeFirstException fix config — LGTM

Matches existing pattern for fix-capable rules.


3017-3020: Type union for UseBiomeIgnoreFolder fix config — LGTM

Consistent with neighbouring declarations.


5114-5127: RuleWithFixOptions_for_NoBiomeFirstExceptionOptions — LGTM

Shape aligns with other fixable rules (fix, level, options).


5532-5545: RuleWithFixOptions_for_UseBiomeIgnoreFolderOptions — LGTM

Consistent with the codegen conventions.


8642-8642: Categories wired for new rules — LGTM

The Category union includes both new entries; good for LSP surfacing.

Also applies to: 8698-8698

@dyc3
Copy link
Contributor

dyc3 commented Aug 9, 2025

Yeah, let's keep them as rules. I think having the code actions is more valuable than the alternatives.

@ematipico ematipico changed the base branch from main to next August 10, 2025 10:00
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: 0

🧹 Nitpick comments (1)
crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc (1)

1-10: Add coverage for trailing slash without glob (e.g. "!dist/").

If the rule also disallows a bare trailing slash, add a sibling invalid fixture to lock this down.

Proposed new test file contents:

// crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid_trailing_slash.biome.jsonc
// should generate diagnostics
{
  "files": {
    "includes": [
      "**",
      "!dist/",
      "!**/dist/"
    ]
  }
}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between da3d9a2 and a6a9012.

⛔ Files ignored due to path filters (5)
  • crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/invalid.biome.jsonc.snap is excluded by !**/*.snap
  • crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/valid.biome.jsonc.snap is excluded by !**/*.snap
  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc.snap is excluded by !**/*.snap
  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid.biome.jsonc.snap is excluded by !**/*.snap
  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid_overrides.biome.jsonc.snap is excluded by !**/*.snap
📒 Files selected for processing (5)
  • crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/invalid.biome.jsonc (1 hunks)
  • crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/valid.biome.jsonc (1 hunks)
  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc (1 hunks)
  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid.biome.jsonc (1 hunks)
  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid_overrides.biome.jsonc (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/invalid.biome.jsonc
  • crates/biome_json_analyze/tests/specs/suspicious/noBiomeFirstException/valid.biome.jsonc
  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid_overrides.biome.jsonc
🧰 Additional context used
📓 Path-based instructions (1)
crates/biome_*/**/*

📄 CodeRabbit Inference Engine (CLAUDE.md)

Core crates must be located in /crates/biome_*/

Files:

  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid.biome.jsonc
  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc
🧠 Learnings (10)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:43:46.589Z
Learning: Applies to crates/biome_analyze/**/src/lint/nursery/**/*.rs : Use meaningful, cross-language-capable rule names when appropriate; use language/framework-specific names when constrained
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:43:46.589Z
Learning: Applies to crates/biome_analyze/**/src/lint/nursery/**/*.rs : Set version: "next" in declare_lint_rule! for new or changing rules
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:43:46.589Z
Learning: Applies to crates/biome_analyze/**/src/lint/nursery/**/*.rs : Use precise naming conventions for rules: no<Concept> to forbid, use<Concept> to mandate; and established patterns like noDuplicate<>, noUnused<>, useConsistent<>
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:43:46.589Z
Learning: Applies to crates/biome_analyze/**/src/lint/nursery/**/*.rs : New analyzer rules must be placed in the nursery group
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:43:46.589Z
Learning: Applies to crates/biome_analyze/**/src/lint/nursery/**/*.rs : Assign domains to rules when applicable (e.g., testing, frameworks) via domains field
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:43:46.589Z
Learning: Applies to crates/biome_analyze/**/src/lint/nursery/**/*.rs : Deprecate rules by adding deprecated: reason in declare_lint_rule!
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:43:46.589Z
Learning: Applies to crates/biome_analyze/**/src/lint/nursery/**/*.rs : If a rule provides code actions, add fix_kind to declare_lint_rule! and pass category and applicability in action()
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:43:46.589Z
Learning: Applies to crates/biome_analyze/**/src/lint/nursery/**/*.rs : Use the declare_lint_rule! macro to declare each rule
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:43:46.589Z
Learning: Applies to crates/biome_analyze/**/src/lint/nursery/**/*.rs : When porting a lint rule, specify sources in declare_lint_rule! (e.g., RuleSource::Eslint(...).same() or .inspired())
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:43:46.589Z
Learning: Applies to crates/biome_analyze/**/src/lint/nursery/**/*.rs : Set rule severity appropriately; default is info, explicitly set Severity when needed
📚 Learning: 2025-08-11T11:43:46.589Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:43:46.589Z
Learning: Applies to crates/biome_analyze/crates/biome_js_analyze/tests/specs/**/*.jsonc : .jsonc snapshot test files must contain an array of strings (snippets) and are interpreted as script

Applied to files:

  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid.biome.jsonc
  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc
📚 Learning: 2025-08-11T11:43:46.589Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:43:46.589Z
Learning: Applies to crates/biome_analyze/crates/biome_js_analyze/tests/specs/** : Place JS rule snapshot tests under tests/specs/<group>/<ruleName>/ with files prefixed by invalid* and valid*

Applied to files:

  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid.biome.jsonc
  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc
📚 Learning: 2025-08-11T11:43:46.589Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:43:46.589Z
Learning: Applies to crates/biome_analyze/crates/biome_js_analyze/tests/quick_test.rs : Quick test lives in biome_js_analyze/tests/quick_test.rs; unignore it and set RuleFilter appropriately when using

Applied to files:

  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid.biome.jsonc
  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc
📚 Learning: 2025-08-11T11:48:27.756Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.756Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/specs/html/**/options.json : When non-default formatting options are needed for a test group, place an options.json (biome.json format) alongside the .html files in that folder

Applied to files:

  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid.biome.jsonc
  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc
📚 Learning: 2025-08-11T11:48:27.756Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.756Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/specs/html/**/*.html : Place HTML test fixtures under tests/specs/html and subfolders, using .html files

Applied to files:

  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid.biome.jsonc
📚 Learning: 2025-08-11T11:48:27.756Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.756Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_tests.rs : Create tests/spec_tests.rs in the biome_html_formatter crate that generates tests via tests_macros::gen_tests! for all HTML files at tests/specs/html/**/*.html

Applied to files:

  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
PR: biomejs/biome#7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.

Applied to files:

  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc
📚 Learning: 2025-08-11T11:48:27.756Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.756Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_test.rs : Create tests/spec_test.rs implementing the run(spec_input_file, _expected_file, test_directory, _file_type) function as shown and include!("language.rs")

Applied to files:

  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc
📚 Learning: 2025-08-11T11:43:46.589Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:43:46.589Z
Learning: Applies to crates/biome_analyze/**/src/lint/nursery/**/*.rs : Code blocks in docs must specify language; invalid examples must use expect_diagnostic; snippets must emit exactly one diagnostic

Applied to files:

  • crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc
🔇 Additional comments (3)
crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/valid.biome.jsonc (2)

5-8: LGTM: correct folder-ignore patterns without trailing globs.

This uses "!dist" and "!/dist" (no "/"), which aligns with the intended rule and should avoid unnecessary file crawling. Covers both root and nested dist folders.


5-8: Question: do we need both "!dist" and "!/dist"?**

Depending on the matcher semantics of "/dist" (zero-or-more segments), "!/dist" alone may already match the root "dist". If so, "!dist" is redundant. Worth verifying to keep guidance crisp.

crates/biome_json_analyze/tests/specs/suspicious/useBiomeIgnoreFolder/invalid.biome.jsonc (1)

6-8: Good invalid cases: trailing "/" should be flagged.**

These patterns are exactly what the rule aims to catch and should yield diagnostics. Nice contrast with the valid fixture.

@ematipico ematipico merged commit df3afdf into next Aug 11, 2025
29 checks passed
@ematipico ematipico deleted the feat/use-ignore-folder branch August 11, 2025 12:41
ematipico added a commit that referenced this pull request Aug 12, 2025
…7159)

Co-authored-by: dyc3 <1808807+dyc3@users.noreply.github.com>
Co-authored-by: siketyan <12772118+siketyan@users.noreply.github.com>
@github-actions github-actions bot mentioned this pull request Aug 13, 2025
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-JSON Language: JSON and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载