Bug 1425047 - Enable rest of ESLint rules for mobile/android. r=esawin

This enables consistent-return, no-empty and no-redeclare.

Differential Revision: https://phabricator.services.mozilla.com/D60827

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mark Banner 2020-01-24 17:32:38 +00:00
Родитель c7825a859e
Коммит b6a7518552
12 изменённых файлов: 12 добавлений и 24 удалений

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

@ -1,14 +1,6 @@
"use strict";
module.exports = {
rules: {
// Rules enabled in mozilla/recommended, and disabled for now, we should
// re-enable these over time.
"consistent-return": "off",
"no-empty": "off",
"no-redeclare": "off",
},
"overrides": [{
files: [
// Bug 1425048 - mainly going away, see bug 1583370.

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

@ -51,7 +51,7 @@ class LoadURIDelegateChild extends GeckoViewActorChild {
if (!this.isContentWindow) {
debug`loadURI: not a content window`;
// This is an internal Gecko window, nothing to do
return;
return false;
}
return LoadURIDelegate.load(
@ -72,7 +72,7 @@ class LoadURIDelegateChild extends GeckoViewActorChild {
if (!this.isContentWindow) {
// This is an internal Gecko window, nothing to do
debug`handleLoadError: not a content window`;
return;
return null;
}
if (aUri && LoadURIDelegate.isSafeBrowsingError(aError)) {

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

@ -14,7 +14,6 @@ ChromeUtils.defineModuleGetter(
"resource://gre/modules/GeckoViewTab.jsm"
);
/* globals EventDispatcher */
var { EventDispatcher } = ChromeUtils.import(
"resource://gre/modules/Messaging.jsm"
);

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

@ -116,7 +116,7 @@ GeckoViewPermission.prototype = {
})
.then(devices => {
if (win.closed) {
return;
return Promise.resolve();
}
let sources = devices.map(device => {

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

@ -484,7 +484,7 @@ PromptDelegate.prototype = {
_showPrompt(aMsg) {
let result = undefined;
if (!this._domWin || !this._changeModalState(/* aEntering */ true)) {
return;
return result;
}
try {
this.asyncShowPrompt(aMsg, res => (result = res));

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

@ -5,7 +5,8 @@
<script>
var start = new Date().getTime();
document.getElementById("content").innerHTML = "Started";
// eslint-disable-next-line no-empty
while((new Date().getTime() - start) < 5000 ) {};
document.getElementById("content").innerHTML = "Finished";
</script>
</html>
</html>

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

@ -81,6 +81,8 @@ const GeckoViewRecordingMedia = {
return STATUS_RECORDING;
case MediaManagerService.STATE_NOCAPTURE:
return STATUS_INACTIVE;
default:
throw new Error("Unexpected activityStatus value");
}
};

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

@ -482,7 +482,7 @@ var GeckoViewUtils = {
}
}
return aLogger[aLevel.toLowerCase()](strs, ...aExprs);
aLogger[aLevel.toLowerCase()](strs, ...aExprs);
},
};

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

@ -12,8 +12,6 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
<script type="application/javascript">
/* globals AndroidLog */
const TAG = "AndroidLogTest";
const VERBOSE_MESSAGE = "This is a verbose message.";

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

@ -12,9 +12,9 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
<script type="application/javascript">
const {Promise} = ChromeUtils.import("resource://gre/modules/Promise.jsm"); /* global Promise */
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); /* global Services */
const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm"); /* global NetUtil */
const {Promise} = ChromeUtils.import("resource://gre/modules/Promise.jsm");
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
function readChannel(url) {
let deferred = Promise.defer();

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

@ -14,8 +14,6 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
"use strict";
/* globals SimpleServiceDiscovery */
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
const {SimpleServiceDiscovery} = ChromeUtils.import("resource://gre/modules/SimpleServiceDiscovery.jsm");

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

@ -14,8 +14,6 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
"use strict";
/* globals SimpleServiceDiscovery */
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
const {SimpleServiceDiscovery} = ChromeUtils.import("resource://gre/modules/SimpleServiceDiscovery.jsm");