Bug 1425244 - Enable ESLint rule no-lonely-if for accessible/tests/mochitest/. r=surkov

MozReview-Commit-ID: DILOcLjsaoF

--HG--
extra : rebase_source : ac66819b55cf689b5264d6ea1ef16d96712cd179
This commit is contained in:
Mark Banner 2017-12-11 13:42:17 +00:00
Родитель c39a3faacd
Коммит 6ad02b364e
4 изменённых файлов: 11 добавлений и 16 удалений

Просмотреть файл

@ -11,7 +11,6 @@ module.exports = {
// XXX These are rules that are enabled in the recommended configuration, but
// disabled here due to failures when initially implemented. They should be
// removed (and hence enabled) at some stage.
"no-lonely-if": "off",
"no-nested-ternary": "off",
"no-new-object": "off",
"no-redeclare": "off",

Просмотреть файл

@ -336,12 +336,10 @@ function eventQueue(aEventType) {
if (checker.unexpected) {
ok(true, msg + `There's no unexpected '${typeStr}' event.`);
} else if (checker.todo) {
todo(false, `Todo event '${typeStr}' was caught`);
} else {
if (checker.todo) {
todo(false, `Todo event '${typeStr}' was caught`);
} else {
ok(true, `${msg} Event '${typeStr}' was handled.`);
}
ok(true, `${msg} Event '${typeStr}' was handled.`);
}
}
}
@ -2001,6 +1999,7 @@ function listenA11yEvents(aStartToListen) {
} else {
// Remove observer when there are no more applicants only.
// '< 0' case should not happen, but just in case: removeObserver() will throw.
// eslint-disable-next-line no-lonely-if
if (--gA11yEventApplicantsCount <= 0)
Services.obs.removeObserver(gA11yEventObserver, "accessible-event");
}

Просмотреть файл

@ -106,10 +106,9 @@
gQueue.push(new synthEscapeKey(editableDoc, new focusChecker(editableDoc)));
if (SEAMONKEY) {
todo(false, "shift tab from editable document fails on (Windows) SeaMonkey! (Bug 718235)");
} else {
if (LINUX || MAC)
} else if (LINUX || MAC) {
todo(false, "shift tab from editable document fails on linux and Mac, bug 746519!");
else
} else {
gQueue.push(new synthShiftTab("link", new focusChecker("link")));
} // ! SEAMONKEY

Просмотреть файл

@ -500,13 +500,11 @@ ExpectedMessage.prototype.lazyCompare = function(aReceived, aExpected, aInfo) {
delta.push(attr + " [ " + childDelta + " ]");
matches = false;
}
} else {
if (received !== expected) {
delta.push(
attr + " [ expected " + JSON.stringify(expected) +
" got " + JSON.stringify(received) + " ]");
matches = false;
}
} else if (received !== expected) {
delta.push(
attr + " [ expected " + JSON.stringify(expected) +
" got " + JSON.stringify(received) + " ]");
matches = false;
}
}