question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rule extract-sequence-expressions fixes can be incorrect

See original GitHub issue

The 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:closed
  • Created 9 months ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
coderaisercommented, Dec 21, 2022

I cannot reproduce the nodelete and _ cases. Could you please re-install 🐊Putout with:

npm i putout

And try again. Is it works for you now? The case with await should work as well 😃.

1reaction
coderaisercommented, Dec 20, 2022

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 😃.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found