This repository was archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 653
feat(rome_js_analyze): noClassAssign
rule
#4033
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for docs-rometools ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
@kaioduarte could you please comment on the issue so I can assign it to you? This will help to show the contributors that the issue is taken already |
leops
reviewed
Dec 12, 2022
crates/rome_js_analyze/src/semantic_analyzers/nursery/no_class_assign.rs
Outdated
Show resolved
Hide resolved
crates/rome_js_analyze/src/semantic_analyzers/nursery/no_class_assign.rs
Outdated
Show resolved
Hide resolved
MichaReiser
suggested changes
Dec 12, 2022
crates/rome_js_analyze/src/semantic_analyzers/nursery/no_class_assign.rs
Outdated
Show resolved
Hide resolved
215b9d6
to
f65086e
Compare
xunilrj
reviewed
Dec 13, 2022
crates/rome_js_analyze/src/semantic_analyzers/nursery/no_class_assign.rs
Outdated
Show resolved
Hide resolved
xunilrj
reviewed
Dec 13, 2022
crates/rome_js_analyze/src/semantic_analyzers/nursery/no_class_assign.rs
Outdated
Show resolved
Hide resolved
eb1b8f5
to
00b4684
Compare
xunilrj
reviewed
Dec 13, 2022
let node = ctx.query(); | ||
let model = ctx.model(); | ||
|
||
if let Ok(Some(id)) = node.id() { |
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.
Nice!
Nit: feel free to ignore:
node.id().and_then(|id| {
id?.as_js_identifier_binding()?.all_writes(model).collect()
}).unwrap_or_default()
You can avoid the collect()
and the allocation with
type Signals = AllBindingsWriteReferenceIter;
MichaReiser
approved these changes
Dec 15, 2022
00b4684
to
628fbf2
Compare
ematipico
approved these changes
Dec 16, 2022
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.
I wonder if there's a way to avoid merge conflicts when merging rules :(
PR looks good, but needs to rebased now and regenerate the files
628fbf2
to
0deb4d7
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Closes #3970.
Test Plan
cargo test -p rome_js_analyze -- no_class_assign