From 3abba7ed456eb12e3217751097475c161d378de5 Mon Sep 17 00:00:00 2001 From: Novout Date: Sat, 13 Nov 2021 13:48:50 -0300 Subject: [PATCH] chore(components): linter correct rules --- .eslintrc.js | 3 +++ .../editor/absolute/shortcuts/EditorShortcutsFinder.vue | 2 -- src/components/editor/entity/EditorEntityInput.vue | 2 +- src/components/editor/entity/EditorEntityShow.vue | 8 +++----- src/components/editor/entity/EditorEntityShowPopover.vue | 8 ++++---- src/components/editor/header/EditorHeaderButton.vue | 2 +- src/components/editor/main/EditorBase.vue | 2 -- src/components/editor/main/EditorBaseHeader.vue | 2 -- src/components/material/InputBoolean.vue | 3 +-- src/components/material/InputText.vue | 2 +- src/pages/Editor.vue | 3 --- 11 files changed, 14 insertions(+), 23 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 9aaa8115d..1f9d074a5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -15,7 +15,10 @@ module.exports = { "vue/valid-v-for": 0, "vue/require-default-prop": 0, "vue/no-parsing-error": 0, + "vue/no-v-html": 0, // editor entities + "vue/require-prop-types": 0, // material any inserts "@typescript-eslint/no-empty-function": 0, + "@typescript-eslint/no-explicit-any": 0, "no-undef": 0, "no-constant-condition": 0, "no-import-assign": 0 diff --git a/src/components/editor/absolute/shortcuts/EditorShortcutsFinder.vue b/src/components/editor/absolute/shortcuts/EditorShortcutsFinder.vue index df2f57dcb..81f1b1394 100644 --- a/src/components/editor/absolute/shortcuts/EditorShortcutsFinder.vue +++ b/src/components/editor/absolute/shortcuts/EditorShortcutsFinder.vue @@ -91,13 +91,11 @@ import { useEntity } from '@/use/entity' import { useAbsoluteStore } from '@/store/absolute' import { useDraggable } from '@vueuse/core' - import { useUtils } from '@/use/utils' const ABSOLUTE = useAbsoluteStore() const { t } = useI18n() const entity = useEntity() - const utils = useUtils() const finder = ref(null) const search = ref(null) diff --git a/src/components/editor/entity/EditorEntityInput.vue b/src/components/editor/entity/EditorEntityInput.vue index d2f739abb..0531d49b7 100644 --- a/src/components/editor/entity/EditorEntityInput.vue +++ b/src/components/editor/entity/EditorEntityInput.vue @@ -194,7 +194,7 @@ import { useUtils } from '@/use/utils' emit('enter', content) return - }, (err: any) => { + }, () => { toast.error(t('toast.generics.error')) }) } diff --git a/src/components/editor/entity/EditorEntityShow.vue b/src/components/editor/entity/EditorEntityShow.vue index 03f77d604..9bfe13f67 100644 --- a/src/components/editor/entity/EditorEntityShow.vue +++ b/src/components/editor/entity/EditorEntityShow.vue @@ -122,8 +122,6 @@ } watch(data, async (_data: string) => { - const _input = input.value as HTMLDivElement - if (_data === env.emptyLine()) { setData('') } @@ -211,7 +209,7 @@ emitter.emit('entity-not-mutate-down', props.entity) }, - (err: any) => { + () => { toast.error(t('toast.generics.error')) } ) @@ -482,10 +480,10 @@ const _input = input.value as HTMLDivElement const value = raw.v2().caret().value(_input) - const position = raw.v2().caret().index(_input) + // const position = raw.v2().caret().index(_input) const end = raw.v2().caret().end(_input) const start = raw.v2().caret().start(_input) - const empty = raw.v2().caret().empty(_input) + // const empty = raw.v2().caret().empty(_input) const offset = useUtils().cursor().getCurrentCursorPosition(_input) if (e.shiftKey) { diff --git a/src/components/editor/entity/EditorEntityShowPopover.vue b/src/components/editor/entity/EditorEntityShowPopover.vue index 710ec6737..7b4739833 100644 --- a/src/components/editor/entity/EditorEntityShowPopover.vue +++ b/src/components/editor/entity/EditorEntityShowPopover.vue @@ -342,13 +342,13 @@ const update = computed(() => format.lastTime(props.entity.updatedAt)) - const onDeleteEntity = (e: MouseEvent) => { + const onDeleteEntity = () => { CONTEXT.removeInPage(props.entity) state.adjust = false } - const onUpEntity = (e: MouseEvent) => { + const onUpEntity = () => { CONTEXT.switchInPage({ entity: props.entity, direction: 'up', @@ -357,7 +357,7 @@ state.adjust = false } - const onDownEntity = (e: MouseEvent) => { + const onDownEntity = () => { CONTEXT.switchInPage({ entity: props.entity, direction: 'down', @@ -412,7 +412,7 @@ state.new = false } - const onSwitcherEntityWrapper = (e: MouseEvent) => { + const onSwitcherEntityWrapper = () => { state.new = false state.switcher = !state.switcher state.adjust = false diff --git a/src/components/editor/header/EditorHeaderButton.vue b/src/components/editor/header/EditorHeaderButton.vue index 40a9886bd..c5734bfe0 100644 --- a/src/components/editor/header/EditorHeaderButton.vue +++ b/src/components/editor/header/EditorHeaderButton.vue @@ -18,7 +18,7 @@ diff --git a/src/components/material/InputBoolean.vue b/src/components/material/InputBoolean.vue index 5ff896de0..d61ddde99 100644 --- a/src/components/material/InputBoolean.vue +++ b/src/components/material/InputBoolean.vue @@ -29,7 +29,7 @@