fix linter issues

This commit is contained in:
hay-kot 2021-08-07 16:49:55 -08:00
parent a1b1b529a3
commit 3ed197a843
21 changed files with 58 additions and 33 deletions

View File

@ -57,9 +57,11 @@ export default {
props: { props: {
comments: { comments: {
type: Array, type: Array,
default: () => [],
}, },
slug: { slug: {
type: String, type: String,
required: true,
}, },
}, },
data() { data() {
@ -85,7 +87,7 @@ export default {
}, },
methods: { methods: {
resetImage() { resetImage() {
this.hideImage == false; this.hideImage = false;
}, },
getProfileImage(id) { getProfileImage(id) {
return api.users.userProfileImage(id); return api.users.userProfileImage(id);

View File

@ -41,7 +41,7 @@ export default {
const split = this.inputText.split("\n"); const split = this.inputText.split("\n");
split.forEach((element, index) => { split.forEach((element, index) => {
if ((element === "\n") | (element == false)) { if ((element === "\n") | (element === false)) {
split.splice(index, 1); split.splice(index, 1);
} }
}); });

View File

@ -49,7 +49,10 @@
<script> <script>
export default { export default {
props: { props: {
extras: Object, extras: {
type: Object,
default: () => ({}),
},
}, },
data() { data() {
return { return {
@ -57,8 +60,8 @@ export default {
dialog: false, dialog: false,
formKey: 1, formKey: 1,
rules: { rules: {
required: v => !!v || this.$i18n.t("recipe.key-name-required"), required: (v) => !!v || this.$i18n.t("recipe.key-name-required"),
whiteSpace: v => !v || v.split(" ").length <= 1 || this.$i18n.t("recipe.no-white-space-allowed"), whiteSpace: (v) => !v || v.split(" ").length <= 1 || this.$i18n.t("recipe.no-white-space-allowed"),
}, },
}; };
}, },

View File

@ -84,6 +84,7 @@ export default {
props: { props: {
value: { value: {
type: Array, type: Array,
default: () => [],
}, },
edit: { edit: {

View File

@ -97,6 +97,7 @@ export default {
props: { props: {
value: { value: {
type: Array, type: Array,
required: true,
}, },
edit: { edit: {
@ -115,13 +116,13 @@ export default {
value: { value: {
handler() { handler() {
this.disabledSteps = []; this.disabledSteps = [];
this.showTitleEditor = this.value.map(x => this.validateTitle(x.title)); this.showTitleEditor = this.value.map((x) => this.validateTitle(x.title));
}, },
}, },
}, },
mounted() { mounted() {
this.showTitleEditor = this.value.map(x => this.validateTitle(x.title)); this.showTitleEditor = this.value.map((x) => this.validateTitle(x.title));
}, },
methods: { methods: {
@ -148,8 +149,6 @@ export default {
isChecked(stepIndex) { isChecked(stepIndex) {
if (this.disabledSteps.includes(stepIndex) && !this.edit) { if (this.disabledSteps.includes(stepIndex) && !this.edit) {
return "disabled-card"; return "disabled-card";
} else {
} }
}, },
toggleShowTitle(index) { toggleShowTitle(index) {

View File

@ -43,6 +43,7 @@ export default {
props: { props: {
value: { value: {
type: Array, type: Array,
required: true,
}, },
edit: { edit: {

View File

@ -21,7 +21,7 @@
<v-list v-if="showViewer" dense class="mt-0 pt-0"> <v-list v-if="showViewer" dense class="mt-0 pt-0">
<v-list-item v-for="(item, key, index) in labels" :key="index"> <v-list-item v-for="(item, key, index) in labels" :key="index">
<v-list-item-content> <v-list-item-content>
<v-list-item-title class="pl-4 text-subtitle-1 flex row "> <v-list-item-title class="pl-4 text-subtitle-1 flex row">
<div>{{ item.label }}</div> <div>{{ item.label }}</div>
<div class="ml-auto mr-1">{{ value[key] }}</div> <div class="ml-auto mr-1">{{ value[key] }}</div>
<div>{{ item.suffix }}</div> <div>{{ item.suffix }}</div>
@ -36,7 +36,10 @@
<script> <script>
export default { export default {
props: { props: {
value: {}, value: {
type: Object,
required: true,
},
edit: { edit: {
type: Boolean, type: Boolean,
default: true, default: true,

View File

@ -69,7 +69,10 @@ export default {
VueMarkdown, VueMarkdown,
}, },
props: { props: {
recipe: Object, recipe: {
type: Object,
required: true,
},
}, },
}; };
</script> </script>

View File

@ -37,7 +37,10 @@
export default { export default {
components: {}, components: {},
props: { props: {
value: Object, value: {
type: Object,
required: true,
},
}, },
computed: { computed: {

View File

@ -36,9 +36,11 @@
export default { export default {
props: { props: {
copyText: { copyText: {
type: String,
default: "Default Copy Text", default: "Default Copy Text",
}, },
color: { color: {
type: String,
default: "primary", default: "primary",
}, },
}, },

View File

@ -24,6 +24,7 @@
export default { export default {
props: { props: {
loading: { loading: {
type: Boolean,
default: true, default: true,
}, },
small: { small: {
@ -62,7 +63,7 @@ export default {
}, },
waitingText() { waitingText() {
return this.$t("general.loading-recipes"); return this.$t("general.loading-recipes");
} },
}, },
}; };
</script> </script>

View File

@ -23,8 +23,14 @@
<script> <script>
export default { export default {
props: { props: {
buttonText: String, buttonText: {
value: String, type: String,
default: "Choose a color",
},
value: {
type: String,
default: "#ff0000",
},
}, },
data() { data() {
return { return {

View File

@ -200,7 +200,8 @@ const icons = {
accountPlusOutline: mdiAccountPlusOutline, accountPlusOutline: mdiAccountPlusOutline,
}; };
export default ({ app }, inject) => { // eslint-disable-next-line no-empty-pattern
export default ({}, inject) => {
// Inject $hello(msg) in Vue, context and store. // Inject $hello(msg) in Vue, context and store.
inject("globals", { icons }); inject("globals", { icons });
}; };

View File

@ -4,7 +4,7 @@ import { store } from "@/store";
// TODO: Migrate to Mixins // TODO: Migrate to Mixins
export const utils = { export const utils = {
recipe: recipe, recipe,
generateUniqueKey(item, index) { generateUniqueKey(item, index) {
return `${item}-${index}`; return `${item}-${index}`;
}, },
@ -16,35 +16,35 @@ export const utils = {
return `${year}-${month}-${day}`; return `${year}-${month}-${day}`;
}, },
notify: { notify: {
info: function(text, title = null) { info(text, title = null) {
store.commit("setSnackbar", { store.commit("setSnackbar", {
open: true, open: true,
title: title, title,
text: text, text,
color: "info", color: "info",
}); });
}, },
success: function(text, title = null) { success(text, title = null) {
store.commit("setSnackbar", { store.commit("setSnackbar", {
open: true, open: true,
title: title, title,
text: text, text,
color: "success", color: "success",
}); });
}, },
error: function(text, title = null) { error(text, title = null) {
store.commit("setSnackbar", { store.commit("setSnackbar", {
open: true, open: true,
title: title, title,
text: text, text,
color: "error", color: "error",
}); });
}, },
warning: function(text, title = null) { warning(text, title = null) {
store.commit("setSnackbar", { store.commit("setSnackbar", {
open: true, open: true,
title: title, title,
text: text, text,
color: "warning", color: "warning",
}); });
}, },

View File

@ -6,8 +6,8 @@ export const recipe = {
*/ */
sortAToZ(list) { sortAToZ(list) {
list.sort((a, b) => { list.sort((a, b) => {
var textA = a.name.toUpperCase(); const textA = a.name.toUpperCase();
var textB = b.name.toUpperCase(); const textB = b.name.toUpperCase();
return textA < textB ? -1 : textA > textB ? 1 : 0; return textA < textB ? -1 : textA > textB ? 1 : 0;
}); });
}, },
@ -42,7 +42,7 @@ const rand = n =>
Math.floor(Math.random() * n) Math.floor(Math.random() * n)
function swap(t, i, j) { function swap(t, i, j) {
let q = t[i]; const q = t[i];
t[i] = t[j]; t[i] = t[j];
t[j] = q; t[j] = q;
return t; return t;