Bug 1181825 - Enable eslint rules for Loop: no-extra-boolean cast, no-redeclare, r=dmose
This commit is contained in:
@@ -47,10 +47,8 @@
|
|||||||
"no-console": 0, // Leave as 0. We use console logging in content code.
|
"no-console": 0, // Leave as 0. We use console logging in content code.
|
||||||
"no-empty": 0, // TODO: Remove (use default)
|
"no-empty": 0, // TODO: Remove (use default)
|
||||||
"no-extra-bind": 0, // Leave as 0
|
"no-extra-bind": 0, // Leave as 0
|
||||||
"no-extra-boolean-cast": 0, // TODO: Remove (use default)
|
|
||||||
"no-multi-spaces": 0, // TBD.
|
"no-multi-spaces": 0, // TBD.
|
||||||
"no-new": 0, // TODO: Remove (use default)
|
"no-new": 0, // TODO: Remove (use default)
|
||||||
"no-redeclare": 0, // TODO: Remove (use default)
|
|
||||||
"no-return-assign": 0, // TODO: Remove (use default)
|
"no-return-assign": 0, // TODO: Remove (use default)
|
||||||
"no-underscore-dangle": 0, // Leave as 0. Commonly used for private variables.
|
"no-underscore-dangle": 0, // Leave as 0. Commonly used for private variables.
|
||||||
"no-unexpected-multiline": 2,
|
"no-unexpected-multiline": 2,
|
||||||
|
|||||||
@@ -700,7 +700,7 @@ loop.contacts = (function(_, mozL10n) {
|
|||||||
category: ["local"]
|
category: ["local"]
|
||||||
};
|
};
|
||||||
var tel = this.state.tel.trim();
|
var tel = this.state.tel.trim();
|
||||||
if (!!tel) {
|
if (tel) {
|
||||||
contact.tel = [{
|
contact.tel = [{
|
||||||
pref: true,
|
pref: true,
|
||||||
type: ["fxos"],
|
type: ["fxos"],
|
||||||
|
|||||||
@@ -700,7 +700,7 @@ loop.contacts = (function(_, mozL10n) {
|
|||||||
category: ["local"]
|
category: ["local"]
|
||||||
};
|
};
|
||||||
var tel = this.state.tel.trim();
|
var tel = this.state.tel.trim();
|
||||||
if (!!tel) {
|
if (tel) {
|
||||||
contact.tel = [{
|
contact.tel = [{
|
||||||
pref: true,
|
pref: true,
|
||||||
type: ["fxos"],
|
type: ["fxos"],
|
||||||
|
|||||||
@@ -151,8 +151,8 @@ loop.shared.mixins = (function() {
|
|||||||
boundingRect.width -= boundOffset;
|
boundingRect.width -= boundOffset;
|
||||||
boundingRect.height -= boundOffset;
|
boundingRect.height -= boundOffset;
|
||||||
|
|
||||||
var x = menuNodeRect.left;
|
x = menuNodeRect.left;
|
||||||
var y = menuNodeRect.top;
|
y = menuNodeRect.top;
|
||||||
|
|
||||||
// If there's an anchor present, position it relative to it first.
|
// If there's an anchor present, position it relative to it first.
|
||||||
var anchor = this.refs.anchor && this.refs.anchor.getDOMNode();
|
var anchor = this.refs.anchor && this.refs.anchor.getDOMNode();
|
||||||
@@ -472,8 +472,8 @@ loop.shared.mixins = (function() {
|
|||||||
// Supply some sensible defaults for the remoteVideoDimensions if no remote
|
// Supply some sensible defaults for the remoteVideoDimensions if no remote
|
||||||
// stream is connected (yet).
|
// stream is connected (yet).
|
||||||
if (!remoteVideoDimensions) {
|
if (!remoteVideoDimensions) {
|
||||||
var node = this._getElement(".remote");
|
node = this._getElement(".remote");
|
||||||
var width = node.offsetWidth;
|
width = node.offsetWidth;
|
||||||
var height = node.offsetHeight;
|
var height = node.offsetHeight;
|
||||||
remoteVideoDimensions = {
|
remoteVideoDimensions = {
|
||||||
width: width,
|
width: width,
|
||||||
|
|||||||
@@ -173,13 +173,13 @@ XPCOMUtils.defineLazyGetter(this, "log", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function setJSONPref(aName, aValue) {
|
function setJSONPref(aName, aValue) {
|
||||||
let value = !!aValue ? JSON.stringify(aValue) : "";
|
let value = aValue ? JSON.stringify(aValue) : "";
|
||||||
Services.prefs.setCharPref(aName, value);
|
Services.prefs.setCharPref(aName, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getJSONPref(aName) {
|
function getJSONPref(aName) {
|
||||||
let value = Services.prefs.getCharPref(aName);
|
let value = Services.prefs.getCharPref(aName);
|
||||||
return !!value ? JSON.parse(value) : null;
|
return value ? JSON.parse(value) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
let gHawkClient = null;
|
let gHawkClient = null;
|
||||||
|
|||||||
@@ -1286,7 +1286,7 @@
|
|||||||
var warningsMismatch = caughtWarnings.length !== expectedWarningsCount;
|
var warningsMismatch = caughtWarnings.length !== expectedWarningsCount;
|
||||||
if (uncaughtError || warningsMismatch) {
|
if (uncaughtError || warningsMismatch) {
|
||||||
$("#results").append("<div class='failures'><em>" +
|
$("#results").append("<div class='failures'><em>" +
|
||||||
(!!(uncaughtError && warningsMismatch) ? 2 : 1) + "</em></div>");
|
((uncaughtError && warningsMismatch) ? 2 : 1) + "</em></div>");
|
||||||
if (warningsMismatch) {
|
if (warningsMismatch) {
|
||||||
$("#results").append("<li class='test fail'>" +
|
$("#results").append("<li class='test fail'>" +
|
||||||
"<h2>Unexpected number of warnings detected in UI-Showcase</h2>" +
|
"<h2>Unexpected number of warnings detected in UI-Showcase</h2>" +
|
||||||
|
|||||||
@@ -1286,7 +1286,7 @@
|
|||||||
var warningsMismatch = caughtWarnings.length !== expectedWarningsCount;
|
var warningsMismatch = caughtWarnings.length !== expectedWarningsCount;
|
||||||
if (uncaughtError || warningsMismatch) {
|
if (uncaughtError || warningsMismatch) {
|
||||||
$("#results").append("<div class='failures'><em>" +
|
$("#results").append("<div class='failures'><em>" +
|
||||||
(!!(uncaughtError && warningsMismatch) ? 2 : 1) + "</em></div>");
|
((uncaughtError && warningsMismatch) ? 2 : 1) + "</em></div>");
|
||||||
if (warningsMismatch) {
|
if (warningsMismatch) {
|
||||||
$("#results").append("<li class='test fail'>" +
|
$("#results").append("<li class='test fail'>" +
|
||||||
"<h2>Unexpected number of warnings detected in UI-Showcase</h2>" +
|
"<h2>Unexpected number of warnings detected in UI-Showcase</h2>" +
|
||||||
|
|||||||
Reference in New Issue
Block a user