Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ToBinio
Copy link
Contributor

@ToBinio ToBinio commented Dec 20, 2025

Summary

This ports vue/define-props-declaration from eslint-plugin-vue.

AI was used to help create tests and write docs.

Example

Invalid

<script setup lang="ts">
const props = defineProps({
kind: { type: String },
});
</script>

Valid

<script setup lang="ts">
const props = defineProps<{
kind: string;
}>();
</script>

Test Plan

Added test cases

@changeset-bot
Copy link

changeset-bot bot commented Dec 20, 2025

🦋 Changeset detected

Latest commit: dd9905f

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-CLI Area: CLI A-Project Area: project A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Diagnostic Area: diagnostocis labels Dec 20, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 20, 2025

Walkthrough

Adds a new Vue lint rule useVueConsistentDefinePropsDeclaration that enforces a consistent defineProps declaration style inside <script setup> (Type vs Runtime). Implements the rule in the analyzer, introduces options (DeclarationStyle and UseVueConsistentDefinePropsDeclarationOptions), test fixtures for valid/invalid cases, and registers the rule. Also narrows an existing Vue macro-order lint to run only in <script setup> contexts. No other public API signatures were changed.

Possibly related PRs

Suggested labels

D-Vue

Suggested reviewers

  • dyc3
  • ematipico

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a new Vue lint rule useVueConsistentDefinePropsDeclaration.
Description check ✅ Passed The description clearly relates to the changeset, explaining the rule being ported from eslint-plugin-vue with examples and test plan.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent 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 6730dc5 and dd9905f.

⛔ Files ignored due to path filters (1)
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-d.vue.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (1)
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
⏰ 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). (14)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: End-to-end tests
  • GitHub Check: Check Dependencies
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Test Node.js API
  • GitHub Check: Check JS Files
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_configuration)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

📜 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 c89cfe2 and adf16a0.

⛔ Files ignored due to path filters (14)
  • 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_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/useVueConsistentDefinePropsDeclaration/invalid-a.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-a.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-b.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-c.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.vue.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 (14)
  • .changeset/eighty-swans-win.md (1 hunks)
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-a.vue (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.json (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.vue (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.options.json (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.vue (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-a.vue (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-b.vue (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-c.vue (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.options.json (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.vue (1 hunks)
  • crates/biome_rule_options/src/lib.rs (1 hunks)
  • crates/biome_rule_options/src/use_vue_consistent_define_props_declaration.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
crates/**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update inline rustdoc documentation for rules, assists, and their options when adding new features or changing existing features in Rust crates

Files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_vue_consistent_define_props_declaration.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
.changeset/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Write changesets that are concise (1-3 sentences), user-focused, use past tense for actions taken and present tense for Biome behavior, include code examples for rules, and end sentences with periods

Files:

  • .changeset/eighty-swans-win.md
🧠 Learnings (35)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Commit rule work with message format `feat(biome_<language>_analyze): <ruleName>`
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options must be placed inside the `biome_rule_options` crate

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `rename_all = "camelCase"` in serde derive macro for rule options

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `deny_unknown_fields` in serde derive macro for rule options

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Implement `Merge` trait for rule options to support configuration inheritance

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.options.json
  • crates/biome_rule_options/src/use_vue_consistent_define_props_declaration.rs
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.options.json
📚 Learning: 2025-12-12T10:11:05.564Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-12T10:11:05.564Z
Learning: Applies to crates/**/*.rs : Update inline rustdoc documentation for rules, assists, and their options when adding new features or changing existing features in Rust crates

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `version` field to `next` in `declare_lint_rule!` macro

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `Box<[T]>` instead of `Vec<T>` for rule options arrays to save memory

Applied to files:

  • crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `deprecated` field to `declare_lint_rule!` macro when deprecating a rule

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*invalid* : Create test files prefixed with `invalid` for code that should trigger the rule

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-a.vue
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*.jsonc : Use `.jsonc` files to contain arrays of code snippet strings for snapshot tests

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.options.json
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*valid* : Create test files prefixed with `valid` for code that should not trigger the rule

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.options.json
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/specs/**/options.json : Create an `options.json` file (formatted as `biome.json`) in test specification folders to apply non-default formatting options to all test files in that folder

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.options.json
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Set `recommended` field to `false` for new rules in the nursery group

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.json
  • .changeset/eighty-swans-win.md
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.options.json
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 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_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.options.json
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Add `issue_number` field to `declare_lint_rule!` macro for work-in-progress rules

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.json
  • .changeset/eighty-swans-win.md
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.options.json
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `language` to `jsx`, `ts`, or `tsx` for rules that only apply to specific JavaScript dialects

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.options.json
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.options.json
📚 Learning: 2025-11-21T01:10:53.059Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.options.json
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options struct must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema`

Applied to files:

  • crates/biome_rule_options/src/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Options` section if the rule has options

Applied to files:

  • crates/biome_rule_options/src/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `use_options` code block property for code examples that follow an options configuration in documentation

Applied to files:

  • crates/biome_rule_options/src/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `declare_lint_rule!` macro to declare analyzer rule types and implement the RuleMeta trait

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).same()` when implementing a rule that matches the behavior of an ESLint rule

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).inspired()` when implementing a rule inspired by but with different behavior than an ESLint rule

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `domains` field in `declare_lint_rule!` to tag rules that belong to specific concepts like testing or frameworks

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `sources` field with `RuleSource` to cite ESLint or other rules that inspired the implementation

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Safe` in `declare_lint_rule!` for safe code actions

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should perform static analysis of source code to detect invalid or error-prone patterns and emit diagnostics with proposed fixes

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use language-specific rule names if the rule is meant for a specific language only

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should check syntax according to language specification and emit error diagnostics

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `language` field in `declare_lint_rule!` macro to the language the rule primarily applies to

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks should be ordered as language, expect_diagnostic, options/full_options/use_options, ignore, file

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
🧬 Code graph analysis (1)
crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs (2)
crates/biome_analyze/src/rule.rs (3)
  • same (252-257)
  • recommended (619-622)
  • domains (649-652)
crates/biome_js_syntax/src/expr_ext.rs (1)
  • callee (33-38)
⏰ 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). (13)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Documentation
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Check Dependencies
  • GitHub Check: Check JS Files
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: autofix
🔇 Additional comments (8)
crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.options.json (1)

1-15: LGTM!

Test configuration is correctly structured for exercising the runtime declaration style.

crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-a.vue (1)

1-5: LGTM!

Valid Type-based defineProps declaration for testing the default style.

crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-a.vue (1)

1-5: LGTM!

Correctly demonstrates invalid runtime declaration when Type style is expected.

crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.vue (1)

1-5: LGTM!

Correctly demonstrates invalid Type-based declaration when runtime style is configured (via accompanying options file).

crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.vue (1)

1-5: LGTM!

Correctly demonstrates invalid runtime declaration when Type style is explicitly configured.

crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.options.json (1)

1-15: LGTM!

Test configuration correctly specifies Type style for the paired invalid test case.

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

394-394: LGTM!

Module export correctly positioned and follows the established pattern.

crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs (1)

54-76: Verify <script setup> context checking.

The rule lacks explicit verification of <script setup> blocks—it only checks file extension. All test fixtures use <script setup lang="ts">, so there's no coverage for regular <script> blocks where defineProps might appear. If Biome parses both contexts identically, the rule could incorrectly flag definitions in regular scripts. Consider either adding context checking or expanding tests to cover that scenario.

Comment on lines +7 to +21
pub struct UseVueConsistentDefinePropsDeclarationOptions {
#[serde(skip_serializing_if = "Option::<_>::is_none")]
pub style: Option<DeclarationStyle>,
}

#[derive(Default, Clone, Debug, Deserialize, Deserializable, Merge, Eq, PartialEq, Serialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[serde(rename_all = "camelCase")]
pub enum DeclarationStyle {
/// defineProps<{...}>()
#[default]
Type,
/// defineProps({...})
Runtime,
}
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 | 🟠 Major

Add rustdoc documentation for the public types.

The public struct and enum are missing documentation. Per coding guidelines, inline rustdoc documentation should be added when introducing new options.

📝 Suggested documentation
+/// Options for the `useVueConsistentDefinePropsDeclaration` rule.
 #[derive(Default, Clone, Debug, Deserialize, Deserializable, Merge, Eq, PartialEq, Serialize)]
 #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
 #[serde(rename_all = "camelCase", deny_unknown_fields, default)]
 pub struct UseVueConsistentDefinePropsDeclarationOptions {
     #[serde(skip_serializing_if = "Option::<_>::is_none")]
+    /// Enforced declaration style for Vue `defineProps`.
     pub style: Option<DeclarationStyle>,
 }

+/// The style of `defineProps` declaration to enforce.
 #[derive(Default, Clone, Debug, Deserialize, Deserializable, Merge, Eq, PartialEq, Serialize)]
 #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
 #[serde(rename_all = "camelCase")]
 pub enum DeclarationStyle {
     /// defineProps<{...}>()
     #[default]
     Type,
     /// defineProps({...})
     Runtime,
 }

Based on coding guidelines for Rust crates.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In crates/biome_rule_options/src/use_vue_consistent_define_props_declaration.rs
around lines 7 to 21, the public struct
UseVueConsistentDefinePropsDeclarationOptions and the public enum
DeclarationStyle lack rustdoc comments; add concise /// documentation above the
struct describing what the options control and note that the style field chooses
the preferred props declaration style, document the style field
(Option<DeclarationStyle>) and its semantics, add /// docs above the enum
DeclarationStyle explaining the two supported declaration styles and that Type
is the default, and add short docs for each enum variant (Type and Runtime)
describing the exact code shape they enforce (e.g., defineProps<{...}>() vs
defineProps({...})); keep wording concise, follow crate style, and ensure
examples or default behavior are mentioned where helpful.

Copy link
Contributor

Choose a reason for hiding this comment

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

The bot is right, these should have doc comments

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 20, 2025

CodSpeed Performance Report

Merging #8521 will not alter performance

Comparing ToBinio:vue-define-props-declaration- (dd9905f) with main (c89cfe2)

Summary

✅ 58 untouched
⏩ 95 skipped1

Footnotes

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

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.

Thanks for the PR! This rule will be great to have.

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

♻️ Duplicate comments (1)
crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs (1)

13-48: Missing issue_number field in rule declaration.

As noted in the previous review, nursery rules require an issue_number field. Please add issue_number: 8521, to the rule declaration.

Based on learnings, nursery rules should include an issue_number field to track work-in-progress status.

🧹 Nitpick comments (3)
.changeset/proud-flowers-hug.md (1)

5-5: Minor style adjustment for changeset.

Per coding guidelines, changesets should use past tense for actions taken and end sentences with periods.

🔎 Suggested wording
-Update [useVueDefineMacrosOrder](https://biomejs.dev/linter/rules/use-vue-define-macros-order/) to only run on <script setup> blocks.
+Updated [useVueDefineMacrosOrder](https://biomejs.dev/linter/rules/use-vue-define-macros-order/) to only run on `<script setup>` blocks.
crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs (2)

75-75: Avoid unnecessary clone of the style option.

The style option is cloned here and again on line 86. Since DeclarationStyle is Copy or could be used by reference in diagnostics, consider using a reference or storing it once to avoid repeated clones.

🔎 Suggested refactor
-        let style = ctx.options().style.clone().unwrap_or_default();
+        let style = ctx.options().style.unwrap_or_default();

121-124: Consider restricting visibility of DeclarationError.

The enum is currently pub, but appears to be used only within this rule. If it's not exported from the parent module, consider using pub(crate) to limit its visibility.

📜 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 adf16a0 and 6730dc5.

⛔ Files ignored due to path filters (7)
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-a.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-d.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-b.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-c.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.vue.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (8)
  • .changeset/eighty-swans-win.md (1 hunks)
  • .changeset/proud-flowers-hug.md (1 hunks)
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs (1 hunks)
  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs (2 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-d.vue (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-b.vue (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-c.vue (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.vue (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .changeset/eighty-swans-win.md
  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-c.vue
🧰 Additional context used
📓 Path-based instructions (2)
crates/**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update inline rustdoc documentation for rules, assists, and their options when adding new features or changing existing features in Rust crates

Files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
.changeset/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Write changesets that are concise (1-3 sentences), user-focused, use past tense for actions taken and present tense for Biome behavior, include code examples for rules, and end sentences with periods

Files:

  • .changeset/proud-flowers-hug.md
🧠 Learnings (23)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Commit rule work with message format `feat(biome_<language>_analyze): <ruleName>`
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Add `issue_number` field to `declare_lint_rule!` macro for work-in-progress rules

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `version` field to `next` in `declare_lint_rule!` macro

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).same()` when implementing a rule that matches the behavior of an ESLint rule

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).inspired()` when implementing a rule inspired by but with different behavior than an ESLint rule

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `language` to `jsx`, `ts`, or `tsx` for rules that only apply to specific JavaScript dialects

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `declare_lint_rule!` macro to declare analyzer rule types and implement the RuleMeta trait

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `sources` field with `RuleSource` to cite ESLint or other rules that inspired the implementation

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Set `recommended` field to `false` for new rules in the nursery group

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `deprecated` field to `declare_lint_rule!` macro when deprecating a rule

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should check syntax according to language specification and emit error diagnostics

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should perform static analysis of source code to detect invalid or error-prone patterns and emit diagnostics with proposed fixes

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks should be ordered as language, expect_diagnostic, options/full_options/use_options, ignore, file

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Safe` in `declare_lint_rule!` for safe code actions

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Unsafe` in `declare_lint_rule!` for unsafe code actions

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `domains` field in `declare_lint_rule!` to tag rules that belong to specific concepts like testing or frameworks

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs
  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*invalid* : Create test files prefixed with `invalid` for code that should trigger the rule

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-d.vue
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `language` field in `declare_lint_rule!` macro to the language the rule primarily applies to

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code; if a token/node is known to be mandatory but is missing, return `None` instead

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Diagnostic should provide a way for the user to fix the issue through log advice, diff advice, or command advice. Add the FIXABLE tag to highlight actionable hints

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use language-specific rule names if the rule is meant for a specific language only

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
📚 Learning: 2025-12-12T10:11:05.564Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-12T10:11:05.564Z
Learning: Applies to .changeset/*.md : Write changesets that are concise (1-3 sentences), user-focused, use past tense for actions taken and present tense for Biome behavior, include code examples for rules, and end sentences with periods

Applied to files:

  • .changeset/proud-flowers-hug.md
⏰ 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). (12)
  • GitHub Check: autofix
  • GitHub Check: End-to-end tests
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Documentation
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Check JS Files
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Test Node.js API
🔇 Additional comments (5)
crates/biome_js_analyze/src/lint/nursery/use_vue_define_macros_order.rs (1)

1-2: Nicely scoped guard condition.

The refactor from file extension checking to is_vue_setup() is a cleaner approach that properly targets <script setup> blocks. Using the Not trait for readability is a nice touch.

Also applies to: 10-11, 118-125

crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-b.vue (1)

1-13: Good coverage for Type-based declaration style.

Solid test case that validates the Type-based defineProps syntax and ensures arbitrary function calls like foo() aren't incorrectly flagged.

crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-d.vue (1)

2-6: Remove duplicate prop declaration syntax.

defineProps can only use either runtime declaration OR type declaration—using both at the same time will result in a compile error. The test currently shows defineProps<{ kind: string }>({ kind: { type: String } }), which violates this. If testing invalid input is intentional, add a comment clarifying the test purpose.

crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.vue (1)

1-13: Good coverage for Runtime declaration style.

This correctly exercises the Runtime-style defineProps pattern with the "style": "runtime" option properly configured in valid-d.vue.options.json.

crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs (1)

126-141: LGTM!

The helper functions are well-structured and use safe option chaining. The logic correctly identifies callee names, type declarations, and runtime declarations.

Comment on lines +77 to +82
match (style, is_type_declaration, is_runtime_declaration) {
(_, true, true) => Some(DeclarationError::InvalidDeclaration),
(DeclarationStyle::Type, _, true) => Some(DeclarationError::WrongStyle),
(DeclarationStyle::Runtime, true, _) => Some(DeclarationError::WrongStyle),
_ => None,
}
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

🧩 Analysis chain

🏁 Script executed:

find crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration -type f -name "*.vue" | head -20

Repository: biomejs/biome

Length of output: 824


🏁 Script executed:

# Check all test files for empty defineProps() calls
for file in crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/*.vue; do
  echo "=== $(basename $file) ==="
  grep -A2 -B2 "defineProps()" "$file" || echo "No empty defineProps found"
done

Repository: biomejs/biome

Length of output: 440


🏁 Script executed:

# Let's examine the content of the test files to see what they cover
for file in crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-*.vue; do
  echo "=== $(basename $file) ==="
  cat "$file"
  echo ""
done

Repository: biomejs/biome

Length of output: 528


🏁 Script executed:

# Examine valid test files
for file in crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-*.vue; do
  echo "=== $(basename $file) ==="
  cat "$file"
  echo ""
done

Repository: biomejs/biome

Length of output: 838


🏁 Script executed:

# Now let's examine the implementation to understand the rule logic
cat -n crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs | head -100

Repository: biomejs/biome

Length of output: 4101


🏁 Script executed:

# Continue reading the implementation
cat -n crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs | tail -100

Repository: biomejs/biome

Length of output: 4252


🏁 Script executed:

# Get the full file to understand the context better
wc -l crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs

Repository: biomejs/biome

Length of output: 148


Document that empty defineProps() calls are not validated by this rule.

This rule enforces declaration style consistency (type vs runtime) but doesn't validate whether defineProps() is called with arguments. Empty defineProps() calls are intentionally accepted and should be caught by a separate validation rule like the ESLint valid-define-props rule. Update the rustdoc to clarify this boundary to avoid confusion.

🤖 Prompt for AI Agents
In
crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
around lines 77-82, the rustdoc should be updated to state that empty
defineProps() calls are intentionally not validated by this rule and thus are
accepted; add a short clarifying sentence to the module/function docstring
indicating that this rule only enforces declaration style (type vs runtime) and
that empty calls should be validated by a separate rule (e.g., ESLint's
valid-define-props), so readers understand the boundary and where to enforce
emptiness checks.

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.

LGTM! Thank you!

@dyc3 dyc3 merged commit a704be9 into biomejs:main Dec 20, 2025
20 checks passed
@github-actions github-actions bot mentioned this pull request Dec 20, 2025
@ToBinio
Copy link
Contributor Author

ToBinio commented Dec 21, 2025

Thanks a lot for the super quick reviews!

@ToBinio ToBinio deleted the vue-define-props-declaration- branch December 21, 2025 07:56
dibashthapa pushed a commit to dibashthapa/biome that referenced this pull request Dec 21, 2025
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