Skip to content

Commit

Permalink
chore(lint): Eslint 9 update
Browse files Browse the repository at this point in the history
  • Loading branch information
bastienwirtz committed Oct 16, 2024
1 parent 56a5c0c commit bff0d8b
Show file tree
Hide file tree
Showing 45 changed files with 330 additions and 339 deletions.
17 changes: 0 additions & 17 deletions .eslintrc.cjs

This file was deleted.

21 changes: 21 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

import js from "@eslint/js";
import pluginVue from 'eslint-plugin-vue'
import eslintConfigPrettier from "eslint-config-prettier";

export default [
js.configs.recommended,
...pluginVue.configs['flat/recommended'],
eslintConfigPrettier,
{
files: ['**/*.{vue,js,jsx,mjs,cjs}'],
rules: {
"vue/multi-word-component-names": "off",
"vue/require-default-prop": "off",
"vue/no-v-html": "off",
},
},
{
ignores: ["**/dist/"],
}
];
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"mock": "http-server dummy-data/ --cors",
"build": "vite build",
"preview": "vite preview --port 5050",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
"lint": "eslint . --fix"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^6.6.0",
Expand All @@ -17,10 +17,9 @@
"yaml": "^2.6.0"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.10.2",
"@vitejs/plugin-vue": "^5.1.4",
"@vue/eslint-config-prettier": "^10.0.0",
"eslint": "^8.57.0",
"eslint": "^9.12.0",
"eslint-plugin-vue": "^9.29.0",
"http-server": "^14.1.1",
"prettier": "^3.3.3",
Expand Down
346 changes: 165 additions & 181 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div
id="app"
v-if="config"
id="app"
:class="[
`theme-${config.theme}`,
`page-${currentPage}`,
Expand Down Expand Up @@ -32,16 +32,16 @@
@navbar-toggle="showMenu = !showMenu"
>
<DarkMode
:default-value="config.defaults.colorTheme"
@updated="isDark = $event"
:defaultValue="this.config.defaults.colorTheme"
/>

<SettingToggle
@updated="vlayout = $event"
name="vlayout"
icon="fa-list"
iconAlt="fa-columns"
:defaultValue="this.config.defaults.layout == 'columns'"
icon-alt="fa-columns"
:default-value="config.defaults.layout == 'columns'"
@updated="vlayout = $event"
/>

<SearchInput
Expand Down Expand Up @@ -73,9 +73,9 @@
<template v-for="(group, groupIndex) in services">
<h2
v-if="group.name"
:key="`header-${groupIndex}`"
class="column is-full group-title"
:class="group.class"
:key="`header-${groupIndex}`"
>
<i v-if="group.icon" :class="['fa-fw', group.icon]"></i>
<div v-else-if="group.logo" class="group-logo media-left">
Expand Down Expand Up @@ -105,9 +105,9 @@
class="columns is-multiline layout-vertical"
>
<div
:class="['column', `is-${12 / config.columns}`]"
v-for="(group, groupIndex) in services"
:key="groupIndex"
:class="['column', `is-${12 / config.columns}`]"
>
<h2 v-if="group.name" class="group-title" :class="group.class">
<i v-if="group.icon" :class="['fa-fw', group.icon]"></i>
Expand All @@ -134,8 +134,8 @@
<footer class="footer">
<div class="container">
<div
class="content has-text-centered"
v-if="config.footer"
class="content has-text-centered"
v-html="config.footer"
></div>
</div>
Expand Down Expand Up @@ -275,7 +275,7 @@ export default {
try {
const service = this.services[0].items[0];
window.open(service.url, target || service.target || "_self");
} catch (error) {
} catch {
console.warn("fail to open service");
}
},
Expand Down
3 changes: 2 additions & 1 deletion src/components/DarkMode.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<a
@click="toggleTheme()"
aria-label="Toggle dark mode"
class="navbar-item is-inline-block-mobile"
@click="toggleTheme()"
>
<i
:class="`${faClasses[mode]}`"
Expand All @@ -18,6 +18,7 @@ export default {
props: {
defaultValue: String,
},
emits: ['updated'],
data: function () {
return {
isDark: null,
Expand Down
10 changes: 5 additions & 5 deletions src/components/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ export default {
message: {},
};
},
created: async function () {
// Look for a new message if an endpoint is provided.
this.message = Object.assign({}, this.item);
await this.getMessage();
},
computed: {
show: function () {
return this.message.title || this.message.content;
Expand All @@ -40,6 +35,11 @@ export default {
this.message = Object.assign({}, item);
},
},
created: async function () {
// Look for a new message if an endpoint is provided.
this.message = Object.assign({}, this.item);
await this.getMessage();
},
methods: {
getMessage: async function () {
if (!this.item) {
Expand Down
7 changes: 4 additions & 3 deletions src/components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
aria-expanded="false"
class="navbar-burger"
:class="{ 'is-active': showMenu }"
v-on:click="$emit('navbar-toggle')"
@click="$emit('navbar-toggle')"
>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
Expand All @@ -19,10 +19,10 @@
<div class="navbar-menu" :class="{ 'is-active': showMenu }">
<div class="navbar-start">
<a
class="navbar-item"
rel="noreferrer"
v-for="(link, key) in links"
:key="key"
class="navbar-item"
rel="noreferrer"
:href="link.url"
:target="link.target"
>
Expand Down Expand Up @@ -52,6 +52,7 @@ export default {
},
links: Array,
},
emits: ['navbar-toggle'],
computed: {
showMenu: function () {
return this.open && this.isSmallScreen();
Expand Down
9 changes: 5 additions & 4 deletions src/components/SearchInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<label for="search" class="search-label"></label>
<input
id="search"
ref="search"
name="search"
type="search"
ref="search"
:value="value"
@input.stop="search($event.target.value)"
@keydown.enter.exact.prevent="open()"
Expand All @@ -26,6 +26,7 @@ export default {
default: "/",
},
},
emits: ["search-open", "search-focus", "search-cancel", "input"],
mounted() {
this._keyListener = function (event) {
if (event.key === this.hotkey) {
Expand All @@ -46,6 +47,9 @@ export default {
this.focus();
}
},
beforeUnmount() {
document.removeEventListener("keydown", this._keyListener);
},
methods: {
open: function (target = null) {
if (!this.$refs.search.value) {
Expand Down Expand Up @@ -79,9 +83,6 @@ export default {
this.$emit("input", value.toLowerCase());
},
},
beforeUnmount() {
document.removeEventListener("keydown", this._keyListener);
},
};
</script>

Expand Down
3 changes: 2 additions & 1 deletion src/components/SettingToggle.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<a
@click.prevent="toggleSetting()"
class="navbar-item is-inline-block-mobile"
@click.prevent="toggleSetting()"
>
<span><i :class="['fas', 'fa-fw', value ? icon : secondaryIcon]"></i></span>
<slot></slot>
Expand All @@ -17,6 +17,7 @@ export default {
iconAlt: String,
defaultValue: Boolean,
},
emits: ["updated"],
data: function () {
return {
secondaryIcon: null,
Expand Down
6 changes: 3 additions & 3 deletions src/components/services/AdGuardHome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import Generic from "./Generic.vue";
export default {
name: "AdGuardHome",
components: {
Generic,
},
mixins: [service],
props: {
item: Object,
},
components: {
Generic,
},
data: () => {
return {
status: null,
Expand Down
6 changes: 3 additions & 3 deletions src/components/services/CopyToClipboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import Generic from "./Generic.vue";
export default {
name: "CopyToClipboard",
components: {
Generic,
},
mixins: [service],
props: {
item: Object,
},
components: {
Generic,
},
data: () => ({
animate: false,
}),
Expand Down
6 changes: 3 additions & 3 deletions src/components/services/Emby.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import Generic from "./Generic.vue";
export default {
name: "Emby",
components: {
Generic,
},
mixins: [service],
props: {
item: Object,
},
components: {
Generic,
},
data: () => ({
status: "",
albumCount: 0,
Expand Down
4 changes: 2 additions & 2 deletions src/components/services/Generic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
<div class="media-content">
<slot name="content">
<p class="title">{{ item.name }}</p>
<p class="subtitle" v-if="item.subtitle">
<p v-if="item.subtitle" class="subtitle">
{{ item.subtitle }}
</p>
</slot>
</div>
<slot name="indicator" class="indicator"></slot>
</div>
<div class="tag" :class="item.tagstyle" v-if="item.tag">
<div v-if="item.tag" class="tag" :class="item.tagstyle">
<strong class="tag-text">#{{ item.tag }}</strong>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/components/services/Healthchecks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import Generic from "./Generic.vue";
export default {
name: "Healthchecks",
components: {
Generic,
},
mixins: [service],
props: {
item: Object,
},
components: {
Generic,
},
data: () => ({
api: null,
}),
Expand Down
6 changes: 3 additions & 3 deletions src/components/services/HomeAssistant.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import Generic from "./Generic.vue";
export default {
name: "HomeAssistant",
components: {
Generic,
},
mixins: [service],
props: {
item: Object,
},
components: {
Generic,
},
data: () => ({
status: "",
version: "",
Expand Down
Loading

0 comments on commit bff0d8b

Please sign in to comment.