From 99866c76174b3b5f5a545ad37937a346c31c2423 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 20 Apr 2023 16:29:44 +0200 Subject: [PATCH] chore(examples-nuxt): lint Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --- examples/nuxt3/.eslintrc.js | 3 +++ examples/nuxt3/components/BasicFlow.vue | 15 ++++++++++----- examples/nuxt3/package.json | 3 ++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/examples/nuxt3/.eslintrc.js b/examples/nuxt3/.eslintrc.js index e4b0b38c..6b1917f7 100644 --- a/examples/nuxt3/.eslintrc.js +++ b/examples/nuxt3/.eslintrc.js @@ -1,3 +1,6 @@ module.exports = { extends: ['@tooling/eslint-config'], + rules: { + 'no-console': 0, + }, } diff --git a/examples/nuxt3/components/BasicFlow.vue b/examples/nuxt3/components/BasicFlow.vue index f9cfb1b5..bf22b583 100644 --- a/examples/nuxt3/components/BasicFlow.vue +++ b/examples/nuxt3/components/BasicFlow.vue @@ -37,8 +37,8 @@ const dark = ref(false) * To update node properties you can simply use your elements v-model and mutate the elements directly * Changes should always be reflected on the graph reactively, without the need to overwrite the elements */ -const updatePos = () => - elements.value.forEach((el) => { +function updatePos() { + return elements.value.forEach((el) => { console.log(el, elements.value) if (isNode(el)) { el.position = { @@ -47,18 +47,23 @@ const updatePos = () => } } }) +} /** * toObject transforms your current graph data to an easily persist-able object */ -const logToObject = () => console.log(instance.value?.toObject()) +function logToObject() { + return console.log(instance.value?.toObject()) +} /** * Resets the current viewpane transformation (zoom & pan) */ -const resetTransform = () => instance.value?.setTransform({ x: 0, y: 0, zoom: 1 }) +function resetTransform() { + return instance.value?.setTransform({ x: 0, y: 0, zoom: 1 }) +} -const toggleClass = () => { +function toggleClass() { dark.value = !dark.value elements.value.forEach((el) => (el.class = dark.value ? 'dark' : 'light')) } diff --git a/examples/nuxt3/package.json b/examples/nuxt3/package.json index 45190a87..01e513f4 100644 --- a/examples/nuxt3/package.json +++ b/examples/nuxt3/package.json @@ -3,7 +3,8 @@ "version": "0.0.0", "private": true, "scripts": { - "dev": "nuxt dev" + "dev": "nuxt dev", + "lint": "eslint --ext .js,.ts,.vue ./" }, "dependencies": { "@vue-flow/background": "workspace:*",