selenium: Replace ES5 one-var assignments with const/let per line
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 1 Oct 2019 01:36:15 +0000 (02:36 +0100)
committerKrinkle <krinklemail@gmail.com>
Tue, 1 Oct 2019 02:18:19 +0000 (02:18 +0000)
commit46586a243c6adf6a7020608173ba5a73fb97ee72
tree6cb8e59a41f510c23780dc37e8956ccc7ca21a14
parenta65edcffc0cde2eb439138f6d66182df0c48fa46
selenium: Replace ES5 one-var assignments with const/let per line

The one-var rule only applies to 'var' where it matters that we
don't let the engine implicitly hoist variables leading to
confusing code that may be unsafe to refactor in a straight-forward
manner.

This doesn't apply to ES6 const and let. While I updated the
rule in 1955a8aa5 to allow ES6, I did not enforce it. Fixed now.
When assigning a value, each assignment should be its own
statement (disallow awkward comma separated assignments).
When not assigning a value, and the lines are next to each other,
they should be in one statement. This makes sense for this small
directory and might make sense to propose for the wikimedia preset
at some point.

Note that the rule I added was not required to make the build
pass. The changes I made are allowed by default by the wikimedia
preset for es6+. The rule I added disallows the previous way.

Change-Id: I26cda095a8a4589084e36273038877f2dd1fc50b
tests/selenium/.eslintrc.json
tests/selenium/pageobjects/history.page.js
tests/selenium/specs/page.js
tests/selenium/specs/rollback.js
tests/selenium/specs/specialrecentchanges.js
tests/selenium/specs/specialwatchlist.js
tests/selenium/specs/user.js
tests/selenium/wdio-mediawiki/RunJobs.js
tests/selenium/wdio-mediawiki/specs/BlankPage.js
tests/selenium/wdio.conf.js