diff --git a/.eslintrc b/.eslintrc index 1044ba11..e7d1ba9a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -45,6 +45,8 @@ "vue/valid-v-on": 0, "vue/no-side-effects-in-computed-properties": 0, "vue/max-attributes-per-line": 0, - "vue/no-v-html": 0 + "vue/no-v-html": 0, + "vue/singleline-html-element-content-newline": 0, + "vue/multi-word-component-names": 0 } } diff --git a/resources/assets/js/App.vue b/resources/assets/js/App.vue index fedc01bb..f21cc9f7 100644 --- a/resources/assets/js/App.vue +++ b/resources/assets/js/App.vue @@ -1,26 +1,26 @@ @@ -92,7 +92,7 @@ onMounted(async () => { }) const init = async () => { - overlay.value.show({ message: 'Just a little patience…' }) + overlay.value!.show({ message: 'Just a little patience…' }) try { await commonStore.init() @@ -108,7 +108,7 @@ const init = async () => { }) await socketService.init() && socketListener.listen() - overlay.value.hide() + overlay.value!.hide() } catch (err) { authenticated.value = false throw err diff --git a/resources/assets/js/__tests__/factory/albumInfoFactory.ts b/resources/assets/js/__tests__/factory/albumInfoFactory.ts index c356177e..85745cbb 100644 --- a/resources/assets/js/__tests__/factory/albumInfoFactory.ts +++ b/resources/assets/js/__tests__/factory/albumInfoFactory.ts @@ -7,6 +7,6 @@ export default (faker: Faker): AlbumInfo => ({ summary: faker.lorem.sentence(), full: faker.lorem.sentences(4) }, - tracks: factory('album-track', 8), + tracks: factory('album-track', 8), url: faker.internet.url() }) diff --git a/resources/assets/js/__tests__/factory/smartPlaylistRuleGroupFactory.ts b/resources/assets/js/__tests__/factory/smartPlaylistRuleGroupFactory.ts index 9c38e3c0..b0f4683f 100644 --- a/resources/assets/js/__tests__/factory/smartPlaylistRuleGroupFactory.ts +++ b/resources/assets/js/__tests__/factory/smartPlaylistRuleGroupFactory.ts @@ -3,5 +3,5 @@ import factory from 'factoria' export default (faker: Faker): SmartPlaylistRuleGroup => ({ id: faker.datatype.number(), - rules: factory('smart-playlist-rule', 3) + rules: factory('smart-playlist-rule', 3) }) diff --git a/resources/assets/js/__tests__/stubs.ts b/resources/assets/js/__tests__/stubs.ts index 8a657a05..3e931f81 100644 --- a/resources/assets/js/__tests__/stubs.ts +++ b/resources/assets/js/__tests__/stubs.ts @@ -5,22 +5,22 @@ import MessageToaster from '@/components/ui/MessageToaster.vue' import DialogBox from '@/components/ui/DialogBox.vue' import Overlay from '@/components/ui/Overlay.vue' -export const MessageToasterStub: Ref> = ref({ +export const MessageToasterStub = ref({ info: noop, success: noop, warning: noop, error: noop -}) +}) as unknown as Ref> -export const DialogBoxStub: Ref> = ref({ +export const DialogBoxStub = ref({ info: noop, success: noop, warning: noop, error: noop, confirm: noop -}) +}) as unknown as Ref> -export const OverlayStub: Ref> = ref({ +export const OverlayStub = ref({ show: noop, hide: noop -}) +}) as unknown as Ref> diff --git a/resources/assets/js/components/album/AlbumCard.vue b/resources/assets/js/components/album/AlbumCard.vue index eaa9781e..3478c2d1 100644 --- a/resources/assets/js/components/album/AlbumCard.vue +++ b/resources/assets/js/components/album/AlbumCard.vue @@ -18,7 +18,6 @@ @@ -28,7 +27,6 @@ v-if="allowDownload" :title="`Download all songs in the album ${album.name}`" class="download-album" - href role="button" @click.prevent="download" > diff --git a/resources/assets/js/components/album/AlbumContextMenu.vue b/resources/assets/js/components/album/AlbumContextMenu.vue index be61e590..a1826084 100644 --- a/resources/assets/js/components/album/AlbumContextMenu.vue +++ b/resources/assets/js/components/album/AlbumContextMenu.vue @@ -3,11 +3,11 @@ @@ -22,7 +22,7 @@ import { useContextMenu, useRouter } from '@/composables' import { eventBus } from '@/utils' const { go } = useRouter() -const { context, base, ContextMenuBase, open, trigger } = useContextMenu() +const { base, ContextMenuBase, open, trigger } = useContextMenu() const album = ref() const allowDownload = toRef(commonStore.state, 'allow_download') @@ -49,6 +49,6 @@ const download = () => trigger(() => downloadService.fromAlbum(album.value!)) eventBus.on('ALBUM_CONTEXT_MENU_REQUESTED', async (e, _album) => { album.value = _album - await open(e.pageY, e.pageX, { album }) + await open(e.pageY, e.pageX) }) diff --git a/resources/assets/js/components/album/AlbumInfo.vue b/resources/assets/js/components/album/AlbumInfo.vue index 1a1aed85..9d37601d 100644 --- a/resources/assets/js/components/album/AlbumInfo.vue +++ b/resources/assets/js/components/album/AlbumInfo.vue @@ -3,24 +3,24 @@

{{ album.name }}

- + diff --git a/resources/assets/js/components/album/__snapshots__/AlbumCard.spec.ts.snap b/resources/assets/js/components/album/__snapshots__/AlbumCard.spec.ts.snap index 1199b2b4..2bf0943e 100644 --- a/resources/assets/js/components/album/__snapshots__/AlbumCard.spec.ts.snap +++ b/resources/assets/js/components/album/__snapshots__/AlbumCard.spec.ts.snap @@ -4,7 +4,7 @@ exports[`renders 1`] = ` `; diff --git a/resources/assets/js/components/artist/ArtistCard.vue b/resources/assets/js/components/artist/ArtistCard.vue index 443b7fa4..496e3448 100644 --- a/resources/assets/js/components/artist/ArtistCard.vue +++ b/resources/assets/js/components/artist/ArtistCard.vue @@ -15,7 +15,6 @@ @@ -25,7 +24,6 @@ v-if="allowDownload" :title="`Download all songs by ${artist.name}`" class="download-artist" - href role="button" @click.prevent="download" > diff --git a/resources/assets/js/components/artist/ArtistContextMenu.vue b/resources/assets/js/components/artist/ArtistContextMenu.vue index 2ad0d7bc..7456da7e 100644 --- a/resources/assets/js/components/artist/ArtistContextMenu.vue +++ b/resources/assets/js/components/artist/ArtistContextMenu.vue @@ -4,11 +4,11 @@
  • Play All
  • Shuffle All
  • @@ -23,7 +23,7 @@ import { useContextMenu, useRouter } from '@/composables' import { eventBus } from '@/utils' const { go } = useRouter() -const { context, base, ContextMenuBase, open, trigger } = useContextMenu() +const { base, ContextMenuBase, open, trigger } = useContextMenu() const artist = ref() const allowDownload = toRef(commonStore.state, 'allow_download') @@ -48,6 +48,6 @@ const download = () => trigger(() => downloadService.fromArtist(artist.value!)) eventBus.on('ARTIST_CONTEXT_MENU_REQUESTED', async (e, _artist) => { artist.value = _artist - await open(e.pageY, e.pageX, { _artist }) + await open(e.pageY, e.pageX) }) diff --git a/resources/assets/js/components/artist/ArtistInfo.vue b/resources/assets/js/components/artist/ArtistInfo.vue index a59e7581..73d5cb8e 100644 --- a/resources/assets/js/components/artist/ArtistInfo.vue +++ b/resources/assets/js/components/artist/ArtistInfo.vue @@ -3,17 +3,17 @@

    {{ artist.name }}

    - + @@ -23,7 +23,7 @@ import { playbackService } from '@/services' import { useContextMenu, useRouter } from '@/composables' const { go } = useRouter() -const { context, base, ContextMenuBase, open, trigger } = useContextMenu() +const { base, ContextMenuBase, open, trigger } = useContextMenu() const folder = ref() @@ -40,13 +40,13 @@ const shuffle = () => trigger(async () => { go('queue') }) -const createPlaylist = () => trigger(() => eventBus.emit('MODAL_SHOW_CREATE_PLAYLIST_FORM', folder.value)) -const createSmartPlaylist = () => trigger(() => eventBus.emit('MODAL_SHOW_CREATE_SMART_PLAYLIST_FORM', folder.value)) -const rename = () => trigger(() => eventBus.emit('MODAL_SHOW_EDIT_PLAYLIST_FOLDER_FORM', folder.value)) -const destroy = () => trigger(() => eventBus.emit('PLAYLIST_FOLDER_DELETE', folder.value)) +const createPlaylist = () => trigger(() => eventBus.emit('MODAL_SHOW_CREATE_PLAYLIST_FORM', folder.value!)) +const createSmartPlaylist = () => trigger(() => eventBus.emit('MODAL_SHOW_CREATE_SMART_PLAYLIST_FORM', folder.value!)) +const rename = () => trigger(() => eventBus.emit('MODAL_SHOW_EDIT_PLAYLIST_FOLDER_FORM', folder.value!)) +const destroy = () => trigger(() => eventBus.emit('PLAYLIST_FOLDER_DELETE', folder.value!)) eventBus.on('PLAYLIST_FOLDER_CONTEXT_MENU_REQUESTED', async (e, _folder) => { folder.value = _folder - await open(e.pageY, e.pageX, { folder }) + await open(e.pageY, e.pageX) }) diff --git a/resources/assets/js/components/playlist/PlaylistFolderSidebarItem.vue b/resources/assets/js/components/playlist/PlaylistFolderSidebarItem.vue index 2767621e..52e1044a 100644 --- a/resources/assets/js/components/playlist/PlaylistFolderSidebarItem.vue +++ b/resources/assets/js/components/playlist/PlaylistFolderSidebarItem.vue @@ -2,18 +2,18 @@
  • - + {{ folder.name }}
      - +
      - - - - + + + +
    diff --git a/resources/assets/js/components/playlist/smart-playlist/CreateSmartPlaylistForm.vue b/resources/assets/js/components/playlist/smart-playlist/CreateSmartPlaylistForm.vue index 66945a88..89ab31ce 100644 --- a/resources/assets/js/components/playlist/smart-playlist/CreateSmartPlaylistForm.vue +++ b/resources/assets/js/components/playlist/smart-playlist/CreateSmartPlaylistForm.vue @@ -14,8 +14,8 @@
    @@ -25,11 +25,11 @@ v-for="(group, index) in collectedRuleGroups" :key="group.id" :group="group" - :isFirstGroup="index === 0" + :is-first-group="index === 0" @input="onGroupChanged" /> - + Group diff --git a/resources/assets/js/components/playlist/smart-playlist/EditSmartPlaylistForm.vue b/resources/assets/js/components/playlist/smart-playlist/EditSmartPlaylistForm.vue index 22a04d4c..eb46f650 100644 --- a/resources/assets/js/components/playlist/smart-playlist/EditSmartPlaylistForm.vue +++ b/resources/assets/js/components/playlist/smart-playlist/EditSmartPlaylistForm.vue @@ -20,8 +20,8 @@ @@ -31,11 +31,11 @@ v-for="(group, index) in mutablePlaylist.rules" :key="group.id" :group="group" - :isFirstGroup="index === 0" + :is-first-group="index === 0" @input="onGroupChanged" /> - +
  • @@ -63,9 +63,7 @@ const playlist = useModal().getFromContext('playlist') const folders = toRef(playlistFolderStore.state, 'folders') -let mutablePlaylist: Playlist - -watch(playlist, () => (mutablePlaylist = reactive(cloneDeep(playlist))), { immediate: true }) +const mutablePlaylist = reactive(cloneDeep(playlist)) const isPristine = () => isEqual(mutablePlaylist.rules, playlist.rules) && mutablePlaylist.name.trim() === playlist.name diff --git a/resources/assets/js/components/playlist/smart-playlist/SmartPlaylistFormBase.vue b/resources/assets/js/components/playlist/smart-playlist/SmartPlaylistFormBase.vue index 7789423b..df663d6f 100644 --- a/resources/assets/js/components/playlist/smart-playlist/SmartPlaylistFormBase.vue +++ b/resources/assets/js/components/playlist/smart-playlist/SmartPlaylistFormBase.vue @@ -1,6 +1,6 @@ diff --git a/resources/assets/js/components/playlist/smart-playlist/SmartPlaylistRule.vue b/resources/assets/js/components/playlist/smart-playlist/SmartPlaylistRule.vue index 077c19bc..dcac5ec6 100644 --- a/resources/assets/js/components/playlist/smart-playlist/SmartPlaylistRule.vue +++ b/resources/assets/js/components/playlist/smart-playlist/SmartPlaylistRule.vue @@ -1,11 +1,11 @@