Add eslint-plugin-sonarjs (#20431)

We had this plugin before but it was removed as it became outdated, now
it was updated again, so it's compatible again.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
silverwind 2022-07-22 03:10:22 +02:00 committed by GitHub
parent 3df33799c1
commit bc17cba835
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 58 additions and 4 deletions

View file

@ -140,7 +140,7 @@ function updateStopwatchData(data) {
$('.stopwatch-cancel').attr('action', `${issueUrl}/times/stopwatch/cancel`);
$('.stopwatch-issue').text(`${repo_owner_name}/${repo_name}#${issue_index}`);
$('.stopwatch-time').text(prettyMilliseconds(seconds * 1000));
updateStopwatchTime(seconds);
updateTimeInterval = updateStopwatchTime(seconds);
btnEl.removeClass('hidden');
}
@ -149,10 +149,10 @@ function updateStopwatchData(data) {
function updateStopwatchTime(seconds) {
const secs = parseInt(seconds);
if (!Number.isFinite(secs)) return;
if (!Number.isFinite(secs)) return null;
const start = Date.now();
updateTimeInterval = setInterval(() => {
return setInterval(() => {
const delta = Date.now() - start;
const dur = prettyMilliseconds(secs * 1000 + delta, {compact: true});
$('.stopwatch-time').text(dur);