-
-
Notifications
You must be signed in to change notification settings - Fork 794
feat(analyze/vue): add useVueConsistentDefinePropsDeclaration #8521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: dd9905f The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
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 |
WalkthroughAdds a new Vue lint rule Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
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. Comment |
There was a problem hiding this 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
⛔ Files ignored due to path filters (14)
crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rsis excluded by!**/migrate/eslint_any_rule_to_biome.rsand included by**crates/biome_configuration/src/analyzer/linter/rules.rsis excluded by!**/rules.rsand included by**crates/biome_configuration/src/generated/domain_selector.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_diagnostics_categories/src/categories.rsis excluded by!**/categories.rsand included by**crates/biome_js_analyze/src/lint/nursery.rsis excluded by!**/nursery.rsand included by**crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-a.vue.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.vue.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.vue.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-a.vue.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-b.vue.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-c.vue.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.vue.snapis excluded by!**/*.snapand included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**packages/@biomejs/biome/configuration_schema.jsonis excluded by!**/configuration_schema.jsonand 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.rscrates/biome_rule_options/src/use_vue_consistent_define_props_declaration.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.options.jsoncrates/biome_rule_options/src/use_vue_consistent_define_props_declaration.rscrates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.jsoncrates/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.rscrates/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.rscrates/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.rscrates/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.jsoncrates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.options.jsoncrates/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.jsoncrates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.jsoncrates/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.jsoncrates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.jsoncrates/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.jsoncrates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.jsoncrates/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.jsoncrates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.json.changeset/eighty-swans-win.mdcrates/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.jsoncrates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.jsoncrates/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.jsoncrates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.json.changeset/eighty-swans-win.mdcrates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.options.jsoncrates/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.jsoncrates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.options.jsoncrates/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.jsoncrates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.jsoncrates/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.jsoncrates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.options.jsoncrates/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
definePropsdeclaration 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 wheredefinePropsmight 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.
crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
Show resolved
Hide resolved
| 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, | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 Performance ReportMerging #8521 will not alter performanceComparing Summary
Footnotes
|
dyc3
left a comment
There was a problem hiding this 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.
crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-c.vue
Outdated
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
Outdated
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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: Missingissue_numberfield in rule declaration.As noted in the previous review, nursery rules require an
issue_numberfield. Please addissue_number: 8521,to the rule declaration.Based on learnings, nursery rules should include an
issue_numberfield 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
DeclarationStyleisCopyor 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 ofDeclarationError.The enum is currently
pub, but appears to be used only within this rule. If it's not exported from the parent module, consider usingpub(crate)to limit its visibility.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (7)
crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-a.vue.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-b.vue.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-c.vue.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/invalid-d.vue.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-b.vue.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-c.vue.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration/valid-d.vue.snapis excluded by!**/*.snapand 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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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 theNottrait 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
definePropssyntax and ensures arbitrary function calls likefoo()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
definePropspattern with the"style": "runtime"option properly configured invalid-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.
| 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, | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
find crates/biome_js_analyze/tests/specs/nursery/useVueConsistentDefinePropsDeclaration -type f -name "*.vue" | head -20Repository: 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"
doneRepository: 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 ""
doneRepository: 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 ""
doneRepository: 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 -100Repository: 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 -100Repository: 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.rsRepository: 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.
dyc3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
|
Thanks a lot for the super quick reviews! |
Summary
This ports vue/define-props-declaration from
eslint-plugin-vue.AI was used to help create tests and write docs.
Example
Invalid
Valid
Test Plan
Added test cases