T
T
tostershmoster2021-10-05 14:31:02
JavaScript
tostershmoster, 2021-10-05 14:31:02

What's wrong with multiple assignment?

to such a wonderful line of code

let observers : Function[] = presenter.view.changeSettingsObserver.observers = [];


eslint curses like this

Unexpected chained assignment. eslint no-multi-assign

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexandroppolus, 2021-10-05
@tostershmoster

There are a bunch of rules in eslint that seem weird. For example, the ban on the operation ++ and --. Or a prohibition to change something inside the object referred to by the argument of the current function. Or, for example, the mandatory use of this in an instance method of a class (a frankly stupid requirement).
In general, it resembles American legislation with jokes like "do not shoot at cacti from the second floor."
So set up lintconfig and don't bother.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question