Skip to content

Commit

Permalink
Merge pull request #49348 from nextcloud/fix/eslint-warnings
Browse files Browse the repository at this point in the history
chore: Resolve ESLint warnings
  • Loading branch information
susnux authored Jan 16, 2025
2 parents 2de855f + 1bed442 commit bca2685
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 37 deletions.
3 changes: 2 additions & 1 deletion apps/files/src/actions/editLocallyAction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ const view = {
name: 'Files',
} as View

// Mock webroot variable
// Mock web root variable
beforeAll(() => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(window as any)._oc_webroot = '';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(window as any).OCA = { Viewer: { open: vi.fn() } }
})

Expand Down
8 changes: 4 additions & 4 deletions apps/files/src/components/FileEntryMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ export default defineComponent({
/**
* When the source changes, reset the preview
* and fetch the new one.
* @param a
* @param b
* @param newSource The new value of the source prop
* @param oldSource The previous value
*/
source(a: Node, b: Node) {
if (a.source !== b.source) {
source(newSource: Node, oldSource: Node) {
if (newSource.source !== oldSource.source) {
this.resetState()
}
},
Expand Down
2 changes: 1 addition & 1 deletion apps/files/src/components/SidebarTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default {
},
icon: {
type: String,
required: false,
default: '',
},

/**
Expand Down
16 changes: 6 additions & 10 deletions apps/files/src/services/PreviewService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@ const SWCacheName = 'previews'

/**
* Check if the preview is already cached by the service worker
* @param previewUrl
* @param previewUrl URL to check
*/
export const isCachedPreview = function(previewUrl: string): Promise<boolean> {
export async function isCachedPreview(previewUrl: string): Promise<boolean> {
if (!window?.caches?.open) {
return Promise.resolve(false)
return false
}

return window?.caches?.open(SWCacheName)
.then(function(cache) {
return cache.match(previewUrl)
.then(function(response) {
return !!response
})
})
const cache = await window.caches.open(SWCacheName)
const response = await cache.match(previewUrl)
return response !== undefined
}
4 changes: 2 additions & 2 deletions apps/files/src/store/dragging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export const useDragAndDropStore = defineStore('dragging', {

actions: {
/**
* Set the selection of fileIds
* @param selection
* Set the selection of files being dragged currently
* @param selection array of node sources
*/
set(selection = [] as FileSource[]) {
Vue.set(this, 'dragging', selection)
Expand Down
1 change: 1 addition & 0 deletions apps/files_external/tests/appSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* SPDX-FileCopyrightText: 2014 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import $ from 'jquery'

describe('OCA.Files_External.App tests', function() {
const App = OCA.Files_External.App
Expand Down
11 changes: 5 additions & 6 deletions core/src/components/setup/RecommendedApps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,15 @@
</template>

<script>
import axios from '@nextcloud/axios'
import { generateUrl, imagePath } from '@nextcloud/router'
import { t } from '@nextcloud/l10n'
import { loadState } from '@nextcloud/initial-state'
import { generateUrl, imagePath } from '@nextcloud/router'
import axios from '@nextcloud/axios'
import pLimit from 'p-limit'
import { translate as t } from '@nextcloud/l10n'
import logger from '../../logger.js'

import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'

import logger from '../../logger.js'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'

const recommended = {
calendar: {
Expand Down
4 changes: 2 additions & 2 deletions dist/core-recommendedapps.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-recommendedapps.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-sidebar.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-sidebar.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-users-3239.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-users-3239.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-apps-users-management.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-apps-users-management.js.map

Large diffs are not rendered by default.

0 comments on commit bca2685

Please sign in to comment.