chore: update dev dependencies (#1282)

* update dev dependencies

* upgrade eslint

* resolve several errors

* resolve eslint errors
This commit is contained in:
Hayden 2022-05-25 09:38:21 -08:00 committed by GitHub
parent 01f3fef21f
commit 921fceddea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 802 additions and 934 deletions

View file

@ -35,6 +35,7 @@ module.exports = {
"vue/singleline-html-element-content-newline": "off",
"vue/multiline-html-element-content-newline": "off",
"vue/no-mutating-props": "off",
"vue/no-v-text-v-html-on-component": "warn",
"vue/no-v-for-template-key-on-child": "off",
"vue/valid-v-slot": [
"error",

View file

@ -28,9 +28,13 @@
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title v-text="item.title"></v-list-item-title>
<v-list-item-title>
{{ item.title }}
</v-list-item-title>
<v-list-item-subtitle v-text="item.text"></v-list-item-subtitle>
<v-list-item-subtitle>
{{ item.text }}
</v-list-item-subtitle>
<v-list-item-subtitle>
{{ $d(Date.parse(item.timeStamp), "long") }}
</v-list-item-subtitle>
@ -103,5 +107,4 @@ export default defineComponent({
});
</script>
<style scoped>
</style>
<style scoped></style>

View file

@ -10,23 +10,27 @@
<v-list-item-icon class="ma-auto">
<v-tooltip bottom>
<template #activator="{ on, attrs }">
<v-icon v-bind="attrs" v-on="on" v-text="getIconDefinition(item.icon).icon"></v-icon>
<v-icon v-bind="attrs" v-on="on">
{{ getIconDefinition(item.icon).icon }}
</v-icon>
</template>
<span>{{ getIconDefinition(item.icon).title }}</span>
</v-tooltip>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title class="pl-2" v-text="item.name"></v-list-item-title>
<v-list-item-title class="pl-2">
{{ item.name }}
</v-list-item-title>
</v-list-item-content>
<v-list-item-action>
<v-btn v-if="!edit" color="primary" icon :href="assetURL(item.fileName)" target="_blank" top>
<v-btn v-if="!edit" color="primary" icon :href="assetURL(item.fileName as string)" target="_blank" top>
<v-icon> {{ $globals.icons.download }} </v-icon>
</v-btn>
<div v-else>
<v-btn color="error" icon top @click="value.splice(i, 1)">
<v-icon>{{ $globals.icons.delete }}</v-icon>
</v-btn>
<AppButtonCopy color="" :copy-text="assetEmbed(item.fileName)" />
<AppButtonCopy color="" :copy-text="assetEmbed(item.fileName as string)" />
</div>
</v-list-item-action>
</v-list-item>
@ -36,7 +40,7 @@
<v-spacer></v-spacer>
<BaseDialog
v-model="newAssetDialog"
:title="$t('asset.new-asset')"
:title="$tc('asset.new-asset')"
:icon="getIconDefinition(newAsset.icon).icon"
@submit="addAsset"
>
@ -77,6 +81,7 @@
import { defineComponent, reactive, toRefs, useContext } from "@nuxtjs/composition-api";
import { useStaticRoutes, useUserApi } from "~/composables/api";
import { alert } from "~/composables/use-toast";
import { RecipeAsset } from "~/types/api-types/recipe";
const BASE_URL = window.location.origin;
@ -91,7 +96,7 @@ export default defineComponent({
required: true,
},
value: {
type: Array,
type: Array as () => RecipeAsset[],
required: true,
},
edit: {

View file

@ -29,7 +29,9 @@
<v-list dense>
<v-list-item v-for="(item, index) in menuItems" :key="index" @click="contextMenuEventHandler(item.event)">
<v-list-item-icon>
<v-icon :color="item.color" v-text="item.icon"></v-icon>
<v-icon :color="item.color">
{{ item.icon }}
</v-icon>
</v-list-item-icon>
<v-list-item-title>{{ item.title }}</v-list-item-title>
</v-list-item>

View file

@ -81,7 +81,7 @@
<v-list dense>
<v-list-item v-for="(item, index) in menuItems" :key="index" @click="contextMenuEventHandler(item.event)">
<v-list-item-icon>
<v-icon :color="item.color" v-text="item.icon"></v-icon>
<v-icon :color="item.color"> {{ item.icon }} </v-icon>
</v-list-item-icon>
<v-list-item-title>{{ item.title }}</v-list-item-title>
</v-list-item>
@ -307,7 +307,7 @@ export default defineComponent({
}
// Note: Print is handled as an event in the parent component
const eventHandlers: { [key: string]: () => void } = {
const eventHandlers: { [key: string]: () => void | Promise<any> } = {
delete: () => {
state.recipeDeleteDialog = true;
},

View file

@ -32,7 +32,9 @@
<img src="https://i.pravatar.cc/300" alt="John" />
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title v-text="getMember(item.userId)"></v-list-item-title>
<v-list-item-title>
{{ getMember(item.userId) }}
</v-list-item-title>
</v-list-item-content>
</v-list-item>
</template>
@ -95,31 +97,30 @@ export default defineComponent({
context.emit(INPUT_EVENT, value);
}
const show = props.showHeaders;
const headers = computed(() => {
const hdrs = [];
if (show.id) {
if (props.showHeaders.id) {
hdrs.push({ text: "Id", value: "id" });
}
if (show.owner) {
if (props.showHeaders.owner) {
hdrs.push({ text: "Owner", value: "userId", align: "center" });
}
hdrs.push({ text: "Name", value: "name" });
if (show.categories) {
if (props.showHeaders.categories) {
hdrs.push({ text: "Categories", value: "recipeCategory" });
}
if (show.tags) {
if (props.showHeaders.tags) {
hdrs.push({ text: "Tags", value: "tags" });
}
if (show.tools) {
if (props.showHeaders.tools) {
hdrs.push({ text: "Tools", value: "tools" });
}
if (show.recipeYield) {
if (props.showHeaders.recipeYield) {
hdrs.push({ text: "Yield", value: "recipeYield" });
}
if (show.dateAdded) {
if (props.showHeaders.dateAdded) {
hdrs.push({ text: "Date Added", value: "dateAdded" });
}

View file

@ -134,8 +134,6 @@ export default defineComponent({
},
},
setup(props) {
const { value } = props;
// ==================================================
// Foods
const { foods, workingFoodData, actions: foodActions } = useFoods();
@ -144,7 +142,7 @@ export default defineComponent({
async function createAssignFood() {
workingFoodData.name = foodSearch.value;
await foodActions.createOne();
value.food = foods.value?.find((food) => food.name === foodSearch.value);
props.value.food = foods.value?.find((food) => food.name === foodSearch.value);
}
// ==================================================
@ -155,7 +153,7 @@ export default defineComponent({
async function createAssignUnit() {
workingUnitData.name = unitSearch.value;
await unitActions.createOne();
value.unit = units.value?.find((unit) => unit.name === unitSearch.value);
props.value.unit = units.value?.find((unit) => unit.name === unitSearch.value);
}
const state = reactive({
@ -165,7 +163,7 @@ export default defineComponent({
function toggleTitle() {
if (state.showTitle) {
value.title = "";
props.value.title = "";
}
state.showTitle = !state.showTitle;
}
@ -175,13 +173,21 @@ export default defineComponent({
}
function handleUnitEnter() {
if (value.unit === undefined || value.unit === null || !value.unit.name.includes(unitSearch.value)) {
if (
props.value.unit === undefined ||
props.value.unit === null ||
!props.value.unit.name.includes(unitSearch.value)
) {
createAssignUnit();
}
}
function handleFoodEnter() {
if (value.food === undefined || value.food === null || !value.food.name.includes(foodSearch.value)) {
if (
props.value.food === undefined ||
props.value.food === null ||
!props.value.food.name.includes(foodSearch.value)
) {
createAssignFood();
}
}
@ -202,7 +208,7 @@ export default defineComponent({
// });
// }
if (value.originalText) {
if (props.value.originalText) {
options.push({
text: "See Original Text",
event: "toggle-original",

View file

@ -92,7 +92,7 @@
@click="toggleCollapseSection(index)"
>
<v-toolbar-title v-if="!edit" class="headline">
<v-app-bar-title v-text="step.title"> </v-app-bar-title>
<v-app-bar-title> {{ step.title }} </v-app-bar-title>
</v-toolbar-title>
<v-text-field
v-if="edit"

View file

@ -145,6 +145,8 @@ import { AutoFormItems } from "~/types/auto-forms";
const BLUR_EVENT = "blur";
type ValidatorKey = keyof typeof validators;
export default defineComponent({
name: "AutoForm",
props: {
@ -178,7 +180,7 @@ export default defineComponent({
},
},
setup(props, context) {
function rulesByKey(keys?: string[] | null) {
function rulesByKey(keys?: ValidatorKey[] | null) {
if (keys === undefined || keys === null) {
return [];
}
@ -193,7 +195,7 @@ export default defineComponent({
return list;
}
const defaultRules = computed(() => rulesByKey(props.globalRules));
const defaultRules = computed(() => rulesByKey(props.globalRules as ValidatorKey[]));
function removeByIndex(list: never[], index: number) {
// Removes the item at the index

View file

@ -10,7 +10,7 @@
class="text-start v-card--material__heading mb-n6 mt-n10 pa-7"
dark
>
<v-icon v-if="icon" size="40" v-text="icon" />
<v-icon v-if="icon" size="40"> {{ icon }} </v-icon>
<div v-if="text" class="headline font-weight-thin" v-text="text" />
</v-sheet>
</slot>

View file

@ -2,18 +2,10 @@
<BaseDialog v-model="dialog" :icon="$globals.icons.translate" :title="$tc('language-dialog.choose-language')">
<v-card-text>
{{ $t("language-dialog.select-description") }}
<v-autocomplete
v-model="locale"
:items="locales"
item-text="name"
class="my-3"
hide-details
outlined
offset
>
<v-autocomplete v-model="locale" :items="locales" item-text="name" class="my-3" hide-details outlined offset>
<template #item="{ item }">
<v-list-item-content>
<v-list-item-title v-text="item.name"></v-list-item-title>
<v-list-item-title> {{ item.name }} </v-list-item-title>
<v-list-item-subtitle> {{ item.progress }}% {{ $tc("language-dialog.translated") }} </v-list-item-subtitle>
</v-list-item-content>
</template>

View file

@ -1,6 +1,6 @@
import { AxiosResponse } from "axios";
import { useContext } from "@nuxtjs/composition-api";
import { NuxtAxiosInstance } from "@nuxtjs/axios";
import type { NuxtAxiosInstance } from "@nuxtjs/axios";
import { AdminAPI, Api } from "~/api";
import { ApiRequestInstance, RequestResponse } from "~/types/api";
import { PublicApi } from "~/api/public-api";

View file

@ -25,11 +25,17 @@
<v-divider v-if="item.divider" :key="index" class="mx-2"></v-divider>
<v-list-item v-else :key="item.title" :to="item.to" exact>
<v-list-item-avatar>
<v-icon v-text="item.icon"></v-icon>
<v-icon>
{{ item.icon }}
</v-icon>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title v-text="item.title"></v-list-item-title>
<v-list-item-subtitle v-text="item.subtitle"></v-list-item-subtitle>
<v-list-item-title>
{{ item.title }}
</v-list-item-title>
<v-list-item-subtitle>
{{ item.subtitle }}
</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
</template>

View file

@ -22,7 +22,7 @@
"@nuxtjs/proxy": "^2.1.0",
"@nuxtjs/pwa": "^3.3.5",
"@vue/composition-api": "^1.0.5",
"@vueuse/core": "^6.8.0",
"@vueuse/core": "^8.5.0",
"core-js": "^3.15.1",
"date-fns": "^2.23.0",
"fuse.js": "^6.5.3",
@ -36,21 +36,22 @@
"@babel/eslint-parser": "^7.14.7",
"@nuxt/types": "^2.15.7",
"@nuxt/typescript-build": "^2.1.0",
"@nuxtjs/composition-api": "^0.31.0",
"@nuxtjs/eslint-config-typescript": "^6.0.1",
"@nuxtjs/composition-api": "^0.32.0",
"@nuxtjs/eslint-config-typescript": "^10.0.0",
"@nuxtjs/eslint-module": "^3.0.2",
"@nuxtjs/google-fonts": "^1.3.0",
"@nuxtjs/vuetify": "^1.12.1",
"@types/sortablejs": "^1.10.7",
"@vue/runtime-dom": "^3.2.36",
"eslint": "^7.29.0",
"eslint": "^8.16.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-nuxt": "^3.2.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-vue": "^7.12.1",
"lint-staged": "^10.5.4",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^9.0.1",
"lint-staged": "^12.4.2",
"nuxt-vite": "0.2.3",
"prettier": "^2.3.2",
"typescript": "^4.7.2",
"vue2-script-setup-transform": "^0.3.5"
}
}

View file

@ -40,7 +40,7 @@
>
<template #item="{ item }">
<v-list-item-content>
<v-list-item-title v-text="item.name"></v-list-item-title>
<v-list-item-title> {{ item.name }} </v-list-item-title>
<v-list-item-subtitle>
{{ item.progress }}% {{ $tc("language-dialog.translated") }}
</v-list-item-subtitle>

View file

@ -65,7 +65,7 @@
>
<template #item="{ item }">
<v-list-item-content>
<v-list-item-title v-text="item.name"></v-list-item-title>
<v-list-item-title> {{ item.name }} </v-list-item-title>
<v-list-item-subtitle>
{{ item.progress }}% {{ $tc("language-dialog.translated") }}
</v-list-item-subtitle>

View file

@ -315,8 +315,10 @@ export default defineComponent({
title: "Tag Recipes",
mode: MODES.tag,
tag: "",
// eslint-disable-next-line @typescript-eslint/no-empty-function
callback: () => {},
callback: () => {
// Stub function to be overwritten
return Promise.resolve();
},
icon: $globals.icons.tags,
});

View file

@ -69,7 +69,7 @@
>
<template #item="{ item }">
<v-list-item-content>
<v-list-item-title v-text="item.name"></v-list-item-title>
<v-list-item-title> {{ item.name }} </v-list-item-title>
<v-list-item-subtitle>
{{ item.progress }}% {{ $tc("language-dialog.translated") }}
</v-list-item-subtitle>

View file

@ -216,7 +216,7 @@ export default defineComponent({
if (searchString.value.trim() === "") {
return filteredRecipes.value;
}
const result = fuse.value.search(searchString.value.trim());
const result = fuse.value.search(searchString.value.trim() as string);
return result.map((x) => x.item);
});

View file

@ -1,16 +1,16 @@
import { Plugin } from "@nuxt/types";
import { NuxtAxiosInstance } from "@nuxtjs/axios";
import type { NuxtAxiosInstance } from "@nuxtjs/axios";
import { alert } from "~/composables/use-toast";
const toastPlugin: Plugin = ({ $axios }: { $axios: NuxtAxiosInstance }) => {
$axios.onResponse((response) => {
if (response?.data?.message) {
alert.info(response.data.message);
alert.info(response.data.message as string);
}
});
$axios.onError((error) => {
if (error.response?.data?.detail?.message) {
alert.error(error.response.data.detail.message);
alert.error(error.response.data.detail.message as string);
}
});
};

File diff suppressed because it is too large Load diff