-
-
Notifications
You must be signed in to change notification settings - Fork 792
feat(lint): implement noNestedComponentDefinitions rule
#6053
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
feat(lint): implement noNestedComponentDefinitions rule
#6053
Conversation
CodSpeed Performance ReportMerging #6053 will not alter performanceComparing Summary
|
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.
Great work, as always!
crates/biome_js_analyze/src/lint/nursery/no_nested_component_definitions.rs
Outdated
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/nursery/no_nested_component_definitions.rs
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/nursery/no_nested_component_definitions.rs
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/nursery/no_nested_component_definitions.rs
Outdated
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/nursery/no_nested_component_definitions.rs
Outdated
Show resolved
Hide resolved
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.
Looks great!
Looking forward to the follow up PR, as discussed here: https://github.com/biomejs/biome/pull/6053/files#r2094610735
And, if you're looking for what to work on after that, I think you could take on #50.
|
@mdevils I'll need you to comment on that issue for me to assign it. Github doesn't let you assign non-participants if they aren't a member of the org. |
Summary
Added the new rule
noNestedComponentDefinitions,which disallows nested component definitions in React components.
Closes #4989
This rule is useful for preventing potential performance issues and improving code readability by ensuring that components are defined at the top level.
Example (Invalid):
Example (Valid):
Test Plan
Tests are included.