fix no-empty

ping exception should be impossible, because StrongSocket already
catches native exceptions.

loadScript exception should be impossible, because it returns a Promise.
pull/8592/head
Niklas Fiekas 2021-04-07 16:57:07 +02:00
parent c671e5e380
commit 842a67f0e1
4 changed files with 6 additions and 11 deletions

View File

@ -17,6 +17,7 @@
"rules": { "rules": {
"linebreak-style": ["error", "unix"], "linebreak-style": ["error", "unix"],
"no-duplicate-imports": "error", "no-duplicate-imports": "error",
"@typescript-eslint/no-empty-function": "off",
"eqeqeq": "off", "eqeqeq": "off",
"prefer-const": "off", "prefer-const": "off",
@ -31,8 +32,6 @@
"prefer-spread": "off", "prefer-spread": "off",
"prefer-rest-params": "off", "prefer-rest-params": "off",
"no-useless-escape": "off", "no-useless-escape": "off",
"no-empty": "off",
"@typescript-eslint/no-empty-function": "off",
"no-constant-condition": "off", "no-constant-condition": "off",
"no-async-promise-executor": "off" "no-async-promise-executor": "off"
} }

View File

@ -98,11 +98,7 @@ export default function (element: HTMLElement, ctrl: AnalyseCtrl) {
.filter('.' + panel) .filter('.' + panel)
.addClass('active'); .addClass('active');
if ((panel == 'move-times' || ctrl.opts.hunter) && !lichess.movetimeChart) if ((panel == 'move-times' || ctrl.opts.hunter) && !lichess.movetimeChart)
try { lichess.loadScript('javascripts/chart/movetime.js').then(() => lichess.movetimeChart(data, ctrl.trans));
lichess.loadScript('javascripts/chart/movetime.js').then(function () {
lichess.movetimeChart(data, ctrl.trans);
});
} catch (e) {}
if ((panel == 'computer-analysis' || ctrl.opts.hunter) && $('#acpl-chart').length) if ((panel == 'computer-analysis' || ctrl.opts.hunter) && $('#acpl-chart').length)
setTimeout(startAdvantageChart, 200); setTimeout(startAdvantageChart, 200);
}; };

View File

@ -72,7 +72,9 @@ export default function (opts: CevalOpts): CevalCtrl {
try { try {
sharedMem.grow(8); sharedMem.grow(8);
growableSharedMem = true; growableSharedMem = true;
} catch (e) {} } catch (e) {
// memory growth not supported
}
} }
} }

View File

@ -61,9 +61,7 @@ export default function (opts: ChallengeOpts) {
function pingNow() { function pingNow() {
if (document.getElementById('ping-challenge')) { if (document.getElementById('ping-challenge')) {
try { lichess.socket.send('ping');
lichess.socket.send('ping');
} catch (e) {}
setTimeout(pingNow, 9000); setTimeout(pingNow, 9000);
} }
} }