[web] Fix linting errors

This commit is contained in:
chme 2022-02-19 07:05:59 +01:00
parent c78f861f45
commit 6519b18aa0
28 changed files with 51 additions and 21 deletions

View File

@ -6,5 +6,9 @@ module.exports = {
rules: { rules: {
// override/add rules settings here, such as: // override/add rules settings here, such as:
// 'vue/no-unused-vars': 'error' // 'vue/no-unused-vars': 'error'
'no-unused-vars': ['error', { args: 'none' }],
'vue/require-prop-types': 'off',
'vue/require-default-prop': 'off',
'vue/prop-name-casing': ['warn', 'snake_case']
} }
} }

View File

@ -14,7 +14,7 @@
:show="show_update_dialog" :show="show_update_dialog"
@close="show_update_dialog = false" @close="show_update_dialog = false"
/> />
<notifications v-show="!show_burger_menu" /> <notification-list v-show="!show_burger_menu" />
<navbar-bottom /> <navbar-bottom />
<div <div
v-show="show_burger_menu || show_player_menu" v-show="show_burger_menu || show_player_menu"
@ -27,7 +27,7 @@
<script> <script>
import NavbarTop from '@/components/NavbarTop.vue' import NavbarTop from '@/components/NavbarTop.vue'
import NavbarBottom from '@/components/NavbarBottom.vue' import NavbarBottom from '@/components/NavbarBottom.vue'
import Notifications from '@/components/Notifications.vue' import NotificationList from '@/components/NotificationList.vue'
import ModalDialogRemotePairing from '@/components/ModalDialogRemotePairing.vue' import ModalDialogRemotePairing from '@/components/ModalDialogRemotePairing.vue'
import ModalDialogUpdate from '@/components/ModalDialogUpdate.vue' import ModalDialogUpdate from '@/components/ModalDialogUpdate.vue'
import webapi from '@/webapi' import webapi from '@/webapi'
@ -40,7 +40,7 @@ export default {
components: { components: {
NavbarTop, NavbarTop,
NavbarBottom, NavbarBottom,
Notifications, NotificationList,
ModalDialogRemotePairing, ModalDialogRemotePairing,
ModalDialogUpdate ModalDialogUpdate
}, },

View File

@ -50,12 +50,18 @@ export default {
stopAudio() { stopAudio() {
try { try {
this._audio.pause() this._audio.pause()
} catch (e) {} } catch (e) {
// continue regardless of error
}
try { try {
this._audio.stop() this._audio.stop()
} catch (e) {} } catch (e) {
// continue regardless of error
}
try { try {
this._audio.close() this._audio.close()
} catch (e) {} } catch (e) {
// continue regardless of error
}
} }
} }

View File

@ -14,6 +14,7 @@ import { renderSVG } from '@/lib/SVGRenderer'
export default { export default {
name: 'CoverArtwork', name: 'CoverArtwork',
props: ['artist', 'album', 'artwork_url', 'maxwidth', 'maxheight'], props: ['artist', 'album', 'artwork_url', 'maxwidth', 'maxheight'],
emits: ['click'],
data() { data() {
return { return {

View File

@ -37,6 +37,7 @@
export default { export default {
name: 'DropdownMenu', name: 'DropdownMenu',
// eslint-disable-next-line vue/prop-name-casing
props: ['modelValue', 'options'], props: ['modelValue', 'options'],
emits: ['update:modelValue'], emits: ['update:modelValue'],

View File

@ -119,6 +119,7 @@ export default {
components: { ListItemAlbum, ModalDialogAlbum, ModalDialog, CoverArtwork }, components: { ListItemAlbum, ModalDialogAlbum, ModalDialog, CoverArtwork },
props: ['albums', 'media_kind'], props: ['albums', 'media_kind'],
emits: ['play-count-changed', 'podcast-deleted'],
data() { data() {
return { return {

View File

@ -50,7 +50,8 @@
<script> <script>
export default { export default {
name: 'ModalDialog', name: 'ModalDialog',
props: ['show', 'title', 'ok_action', 'delete_action', 'close_action'] props: ['show', 'title', 'ok_action', 'delete_action', 'close_action'],
emits: ['delete', 'close', 'ok']
} }
</script> </script>

View File

@ -69,6 +69,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogAddRss', name: 'ModalDialogAddRss',
props: ['show'], props: ['show'],
emits: ['close', 'podcast-added'],
data() { data() {
return { return {

View File

@ -69,6 +69,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogAddUrlStream', name: 'ModalDialogAddUrlStream',
props: ['show'], props: ['show'],
emits: ['close'],
data() { data() {
return { return {

View File

@ -100,6 +100,7 @@ export default {
name: 'ModalDialogAlbum', name: 'ModalDialogAlbum',
components: { CoverArtwork }, components: { CoverArtwork },
props: ['show', 'album', 'media_kind', 'new_tracks'], props: ['show', 'album', 'media_kind', 'new_tracks'],
emits: ['close', 'remove-podcast', 'play-count-changed'],
data() { data() {
return { return {

View File

@ -64,6 +64,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogArtist', name: 'ModalDialogArtist',
props: ['show', 'artist'], props: ['show', 'artist'],
emits: ['close'],
methods: { methods: {
play: function () { play: function () {

View File

@ -56,6 +56,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogComposer', name: 'ModalDialogComposer',
props: ['show', 'composer'], props: ['show', 'composer'],
emits: ['close'],
methods: { methods: {
play: function () { play: function () {

View File

@ -42,6 +42,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogDirectory', name: 'ModalDialogDirectory',
props: ['show', 'directory'], props: ['show', 'directory'],
emits: ['close'],
methods: { methods: {
play: function () { play: function () {

View File

@ -44,6 +44,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogGenre', name: 'ModalDialogGenre',
props: ['show', 'genre'], props: ['show', 'genre'],
emits: ['close'],
methods: { methods: {
play: function () { play: function () {

View File

@ -54,6 +54,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogPlaylist', name: 'ModalDialogPlaylist',
props: ['show', 'playlist', 'uris'], props: ['show', 'playlist', 'uris'],
emits: ['close'],
methods: { methods: {
play: function () { play: function () {

View File

@ -65,6 +65,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogPlaylistSave', name: 'ModalDialogPlaylistSave',
props: ['show'], props: ['show'],
emits: ['close'],
data() { data() {
return { return {

View File

@ -119,6 +119,7 @@ import SpotifyWebApi from 'spotify-web-api-js'
export default { export default {
name: 'ModalDialogQueueItem', name: 'ModalDialogQueueItem',
props: ['show', 'item'], props: ['show', 'item'],
emits: ['close'],
data() { data() {
return { return {

View File

@ -58,6 +58,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogRemotePairing', name: 'ModalDialogRemotePairing',
props: ['show'], props: ['show'],
emits: ['close'],
data() { data() {
return { return {

View File

@ -156,6 +156,7 @@ export default {
name: 'ModalDialogTrack', name: 'ModalDialogTrack',
props: ['show', 'track'], props: ['show', 'track'],
emits: ['close', 'play-count-changed'],
data() { data() {
return { return {

View File

@ -49,6 +49,7 @@ export default {
name: 'ModalDialogUpdate', name: 'ModalDialogUpdate',
components: { ModalDialog }, components: { ModalDialog },
props: ['show'], props: ['show'],
emits: ['close'],
data() { data() {
return { return {

View File

@ -102,14 +102,7 @@
<navbar-item-link to="/settings/webinterface"> <navbar-item-link to="/settings/webinterface">
Settings Settings
</navbar-item-link> </navbar-item-link>
<a <a class="navbar-item" @click.stop.prevent="open_update_dialog()">
class="navbar-item"
@click.stop.prevent="
show_update_dialog = true
show_settings_menu = false
show_burger_menu = false
"
>
Update Library Update Library
</a> </a>
<navbar-item-link to="/about"> About </navbar-item-link> <navbar-item-link to="/about"> About </navbar-item-link>
@ -253,6 +246,12 @@ export default {
methods: { methods: {
on_click_outside_settings() { on_click_outside_settings() {
this.show_settings_menu = !this.show_settings_menu this.show_settings_menu = !this.show_settings_menu
},
open_update_dialog() {
this.show_update_dialog = true
this.show_settings_menu = false
this.show_burger_menu = false
} }
} }
} }

View File

@ -23,7 +23,7 @@
import * as types from '@/store/mutation_types' import * as types from '@/store/mutation_types'
export default { export default {
name: 'Notifications', name: 'NotificationList',
components: {}, components: {},
data() { data() {

View File

@ -73,6 +73,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'SpotifyModalDialogAlbum', name: 'SpotifyModalDialogAlbum',
props: ['show', 'album'], props: ['show', 'album'],
emits: ['close'],
data() { data() {
return { return {

View File

@ -57,6 +57,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'SpotifyModalDialogArtist', name: 'SpotifyModalDialogArtist',
props: ['show', 'artist'], props: ['show', 'artist'],
emits: ['close'],
methods: { methods: {
play: function () { play: function () {

View File

@ -60,6 +60,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'SpotifyModalDialogPlaylist', name: 'SpotifyModalDialogPlaylist',
props: ['show', 'playlist'], props: ['show', 'playlist'],
emits: ['close'],
methods: { methods: {
play: function () { play: function () {

View File

@ -81,6 +81,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'SpotifyModalDialogTrack', name: 'SpotifyModalDialogTrack',
props: ['show', 'track', 'album'], props: ['show', 'track', 'album'],
emits: ['close'],
methods: { methods: {
play: function () { play: function () {

View File

@ -36,7 +36,7 @@
:album="album" :album="album"
@click="open_album(album)" @click="open_album(album)"
> >
<template slot:actions> <template #actions>
<a @click="open_dialog(album)"> <a @click="open_dialog(album)">
<span class="icon has-text-dark" <span class="icon has-text-dark"
><i class="mdi mdi-dots-vertical mdi-18px" ><i class="mdi mdi-dots-vertical mdi-18px"

View File

@ -127,13 +127,13 @@
<!-- Composers --> <!-- Composers -->
<content-with-heading v-if="show_composers && composers.total"> <content-with-heading v-if="show_composers && composers.total">
<template slot:heading-left> <template #heading-left>
<p class="title is-4">Composers</p> <p class="title is-4">Composers</p>
</template> </template>
<template slot:content> <template #content>
<list-composers :composers="composers.items" /> <list-composers :composers="composers.items" />
</template> </template>
<template slot:footer> <template #footer>
<nav v-if="show_all_composers_button" class="level"> <nav v-if="show_all_composers_button" class="level">
<p class="level-item"> <p class="level-item">
<a <a
@ -146,7 +146,7 @@
</template> </template>
</content-with-heading> </content-with-heading>
<content-text v-if="show_composers && !composers.total"> <content-text v-if="show_composers && !composers.total">
<template slot:content> <template #content>
<p><i>No composers found</i></p> <p><i>No composers found</i></p>
</template> </template>
</content-text> </content-text>