Merge pull request #4025 from thornbill/eslint-array-callback-return-foreach

Enable eslint array-callback-return foreach checking
This commit is contained in:
Bill Thornton 2022-10-11 03:02:07 -04:00 committed by GitHub
commit 2d0ca949b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 7 deletions

View File

@ -34,7 +34,7 @@ module.exports = {
'plugin:sonarjs/recommended'
],
rules: {
'array-callback-return': ['error'],
'array-callback-return': ['error', { 'checkForEach': true }],
'block-spacing': ['error'],
'brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
'comma-dangle': ['error', 'never'],

View File

@ -159,11 +159,15 @@ import { Events } from 'jellyfin-apiclient';
// (but rewinding cannot happen as the first event with media of non-empty duration)
console.debug(`seeking to ${seconds} on ${e.type} event`);
setCurrentTimeIfNeeded(element, seconds);
events.forEach(name => element.removeEventListener(name, onMediaChange));
events.forEach(name => {
element.removeEventListener(name, onMediaChange);
});
if (onMediaReady) onMediaReady();
}
};
events.forEach(name => element.addEventListener(name, onMediaChange));
events.forEach(name => {
element.addEventListener(name, onMediaChange);
});
}
}
}

View File

@ -205,8 +205,12 @@ function renderTrackSelections(page, instance, item, forceReload) {
});
mediaSources = [];
resolutionNames.forEach(v => mediaSources.push(v));
sourceNames.forEach(v => mediaSources.push(v));
resolutionNames.forEach(v => {
mediaSources.push(v);
});
sourceNames.forEach(v => {
mediaSources.push(v);
});
instance._currentPlaybackMediaSources = mediaSources;

View File

@ -56,7 +56,8 @@ export default function (urls) {
urls.forEach(function (url) {
// the download init has to be sequential for firefox if the urls are not on the same domain
if (browser.firefox && !sameDomain(url)) {
return setTimeout(download.bind(null, url), 100 * ++delay);
setTimeout(download.bind(null, url), 100 * ++delay);
return;
}
download(url);

View File

@ -43,7 +43,9 @@ export default {
*/
downloadFiles(items) {
if (window.NativeShell?.downloadFile) {
items.forEach(item => window.NativeShell.downloadFile(item));
items.forEach(item => {
window.NativeShell.downloadFile(item);
});
return true;
}
return false;