This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 656
feature(rome_js_analyze): no function reassign lint rule #2895
Merged
Conversation
This file contains 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
Deploying with
|
Latest commit: |
29cdf8f
|
Status: | ✅ Deploy successful! |
Preview URL: | https://66249fb4.tools-8rn.pages.dev |
Branch Preview URL: | https://feature-no-function-reassign.tools-8rn.pages.dev |
MichaReiser
reviewed
Jul 19, 2022
Comment on lines
49
to
74
/// function foo() { var foo = bar; } | ||
/// ``` | ||
/// | ||
/// ```js | ||
/// function foo(foo) { foo = bar; } | ||
/// ``` | ||
/// | ||
/// ```js | ||
/// function foo() { var foo; foo = bar; } | ||
/// ``` | ||
/// | ||
/// ```js | ||
/// var foo = () => {}; foo = bar; | ||
/// ``` | ||
/// | ||
/// ```js | ||
/// var foo = function() {}; foo = bar; | ||
/// ``` | ||
/// | ||
/// ```js | ||
/// var foo = function() { foo = bar; }; | ||
/// ``` | ||
/// | ||
/// ```js | ||
/// import bar from 'bar'; | ||
/// function foo() { var foo = bar; } |
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.
Nit: I recommend to use our formatters formatting for the example scripts (maybe something we can add to the code gen in the future?) because I find it more difficult to read
var foo = function () {}; foo = bar;
vs
var foo = function () {}
foo = bar;
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.
That is an idea. In the meantime, I formatted the code manually.
leops
approved these changes
Jul 19, 2022
ematipico
reviewed
Jul 19, 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 left some concern about the diagnostics messaging and the correctness of the rule
crates/rome_js_analyze/src/semantic_analyzers/js/no_function_assign.rs
Outdated
Show resolved
Hide resolved
c1abd92
to
ad91f39
Compare
ematipico
approved these changes
Jul 19, 2022
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 #2878
Test Plan