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 idea: no-multi-assign

See original GitHub issue

Proposing a new rule which forbids multiple assignments in a single expression.

Code that should trigger a warning:

a = b = c;

Code that should not trigger a warning:

b = c;
a = c;

They’re hard to read and it’s not immediately clear what is assigned to what. In above example, one could think that the order of evaluation is left-to-right, while it actually is right-to-left.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:30 (28 by maintainers)

github_iconTop GitHub Comments

3reactions
platinumazurecommented, Aug 26, 2016

I’ll champion.

1reaction
stewxcommented, Jan 11, 2017

I will be submitting a PR for this shortly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

no-multi-assign - Pluggable JavaScript Linter - ESLint
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
JS.BASE.NO.MULTI.ASSIGN - Klocwork Static Code Analysis
Disallow Use of Chained Assignment Expressions (no-multi-assign) ... This rule disallows using multiple assignments within a single statement.
Read more >
Solved: How to add multiple assignment groups in single As...
I have created an assignment rule and added one group(A) to Assigned to Group using a script. if(condition ='true'){. current.assignment_group.
Read more >
How to Create Assignment Rules in Salesforce
Lead – prospect, someone interested in your product or service, but not yet ready to buy. Case – customer's question, complaint, or suggestion...
Read more >
Handle Lead Assignment with Territory Management Rules for ...
An example of why this is needed is for assignment based on zip codes or other geographic/multi-tier rulesets. The ability to manage this...
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