Skip to content

Commit

Permalink
style: add curly rule to eslint (#1761)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroppy authored and evilebottnawi committed Apr 4, 2019
1 parent dcd2434 commit 05b8fb7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Expand Up @@ -8,6 +8,7 @@
"sourceType": "script"
},
"rules": {
"curly": "error",
"consistent-return": "off",
"no-param-reassign": "off",
"no-underscore-dangle": "off",
Expand Down
32 changes: 24 additions & 8 deletions client-src/default/index.js
Expand Up @@ -86,15 +86,19 @@ const onSocketMsg = {
invalid() {
log.info('[WDS] App updated. Recompiling...');
// fixes #1042. overlay doesn't clear if errors are fixed but warnings remain.
if (useWarningOverlay || useErrorOverlay) overlay.clear();
if (useWarningOverlay || useErrorOverlay) {
overlay.clear();
}
sendMsg('Invalid');
},
hash(hash) {
currentHash = hash;
},
'still-ok': function stillOk() {
log.info('[WDS] Nothing changed.');
if (useWarningOverlay || useErrorOverlay) overlay.clear();
if (useWarningOverlay || useErrorOverlay) {
overlay.clear();
}
sendMsg('StillOk');
},
'log-level': function logLevel(level) {
Expand Down Expand Up @@ -135,13 +139,19 @@ const onSocketMsg = {
}
},
'progress-update': function progressUpdate(data) {
if (useProgress) log.info(`[WDS] ${data.percent}% - ${data.msg}.`);
if (useProgress) {
log.info(`[WDS] ${data.percent}% - ${data.msg}.`);
}
sendMsg('Progress', data);
},
ok() {
sendMsg('Ok');
if (useWarningOverlay || useErrorOverlay) overlay.clear();
if (initial) return (initial = false); // eslint-disable-line no-return-assign
if (useWarningOverlay || useErrorOverlay) {
overlay.clear();
}
if (initial) {
return (initial = false);
} // eslint-disable-line no-return-assign
reloadApp();
},
'content-changed': function contentChanged() {
Expand All @@ -155,9 +165,13 @@ const onSocketMsg = {
for (let i = 0; i < strippedWarnings.length; i++) {
log.warn(strippedWarnings[i]);
}
if (useWarningOverlay) overlay.showMessage(warnings);
if (useWarningOverlay) {
overlay.showMessage(warnings);
}

if (initial) return (initial = false); // eslint-disable-line no-return-assign
if (initial) {
return (initial = false);
} // eslint-disable-line no-return-assign
reloadApp();
},
errors(errors) {
Expand All @@ -167,7 +181,9 @@ const onSocketMsg = {
for (let i = 0; i < strippedErrors.length; i++) {
log.error(strippedErrors[i]);
}
if (useErrorOverlay) overlay.showMessage(errors);
if (useErrorOverlay) {
overlay.showMessage(errors);
}
initial = false;
},
error(error) {
Expand Down
12 changes: 9 additions & 3 deletions client-src/live/index.js
Expand Up @@ -41,7 +41,9 @@ $(() => {
borderColor: '#96b5b4',
});
$errors.hide();
if (!hot) iframe.hide();
if (!hot) {
iframe.hide();
}
},
hash(hash) {
currentHash = hash;
Expand All @@ -53,7 +55,9 @@ $(() => {
borderColor: '',
});
$errors.hide();
if (!hot) iframe.show();
if (!hot) {
iframe.show();
}
},
ok() {
okness.text('');
Expand Down Expand Up @@ -118,7 +122,9 @@ $(() => {
});
try {
let old = `${iframe[0].contentWindow.location}`;
if (old.indexOf('about') === 0) old = null;
if (old.indexOf('about') === 0) {
old = null;
}
iframe.attr('src', old || contentPage + window.location.hash);
if (old) {
iframe[0].contentWindow.location.reload();
Expand Down

0 comments on commit 05b8fb7

Please sign in to comment.