Rule extract-sequence-expressions fixes can be incorrect
See original GitHub issueThe rule: extract-sequence-expressions
Often has issues fixing sequence expressions that include extra parenthesis or function calls.
I does well to identify the issues, but fails in fixing them. For example:
Example:
localStorage.setItem('country_code', s),
(global.$stores.useCookieConsent = !t.includes(s));
This will produce the output below
Bad Output:
localStorage.setItem('country_code', s, (global.$stores.useCookieConsent = !t.includes(s)));
It should produce the following output.
Expected Output:
localStorage.setItem('country_code', s);
global.$stores.useCookieConsent = !t.includes(s);
Issue Analytics
- State:
- Created 9 months ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Expressions must evaluate to a value of the expected type - NI ...
Solved: The sequence analyzer is reporting all kinds of errors because I'm indexing the result list. For example: Error in argument 2,
Read more >no-sequences - ESLint - Pluggable JavaScript Linter
"allowInParentheses" : If set to true (default), this rule allows expression sequences that are explicitly wrapped in parentheses. allowInParentheses. Examples ...
Read more >Intro to arithmetic sequences | Algebra (article) - Khan Academy
What is an arithmetic sequence? For many of the examples above, the pattern involves adding or subtracting a number to each term to...
Read more >Everything you need to know about Regular Expressions
After reading this article you will have a solid understanding of what regular expressions are, what they can do, and what they can't...
Read more >The Limit of a Sequence - MIT Mathematics
Could one use the triangle inequality? 3.5 Writing limit proofs. Get in the habit of writing your limit proofs using correct mathematical grammar....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I cannot reproduce the
nodelete
and_
cases. Could you please re-install 🐊Putout with:And try again. Is it works for you now? The case with
await
should work as well 😃.Just lander ability to convert sequence call expressions in
@putout/plugin-extract-sequence-expressions@3.3.0
.With
await
is a bit harder, since it’s ignored on traverse step, but not to much 😃.