Skip to content

Commit

Permalink
chore(components): linter correct rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed Nov 13, 2021
1 parent f4f076b commit 3abba7e
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLElement | null>(null)
const search = ref<HTMLElement | null>(null)
Expand Down
2 changes: 1 addition & 1 deletion src/components/editor/entity/EditorEntityInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ import { useUtils } from '@/use/utils'
emit('enter', content)
return
}, (err: any) => {
}, () => {
toast.error(t('toast.generics.error'))
})
}
Expand Down
8 changes: 3 additions & 5 deletions src/components/editor/entity/EditorEntityShow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@
}
watch(data, async (_data: string) => {
const _input = input.value as HTMLDivElement
if (_data === env.emptyLine()) {
setData('')
}
Expand Down Expand Up @@ -211,7 +209,7 @@
emitter.emit('entity-not-mutate-down', props.entity)
},
(err: any) => {
() => {
toast.error(t('toast.generics.error'))
}
)
Expand Down Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions src/components/editor/entity/EditorEntityShowPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -357,7 +357,7 @@
state.adjust = false
}
const onDownEntity = (e: MouseEvent) => {
const onDownEntity = () => {
CONTEXT.switchInPage({
entity: props.entity,
direction: 'down',
Expand Down Expand Up @@ -412,7 +412,7 @@
state.new = false
}
const onSwitcherEntityWrapper = (e: MouseEvent) => {
const onSwitcherEntityWrapper = () => {
state.new = false
state.switcher = !state.switcher
state.adjust = false
Expand Down
2 changes: 1 addition & 1 deletion src/components/editor/header/EditorHeaderButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script setup lang="ts">
import { useToggle } from '@vueuse/core'
const [value, toggle] = useToggle()
const [value] = useToggle()
const props = defineProps({
color: {
Expand Down
2 changes: 0 additions & 2 deletions src/components/editor/main/EditorBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import { Entity } from '@/types/context'
import { useScroll } from '@/use/scroll'
import { useEnv } from '@/use/env'
import useEmitter from '@/use/emitter'
import { useProject } from '@/use/project'
import { useContextStore } from '@/store/context'
import { useProjectStore } from '@/store/project'
Expand All @@ -56,7 +55,6 @@
const PROJECT = useProjectStore()
const EDITOR = useEditorStore()
const emitter = useEmitter()
const project = useProject()
const plugin = usePlugin()
const env = useEnv()
Expand Down
2 changes: 0 additions & 2 deletions src/components/editor/main/EditorBaseHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,11 @@
import { useAbsoluteStore } from '@/store/absolute'
import { useProjectStore } from '@/store/project'
import { useEnv } from '@/use/env'
import { useI18n } from 'vue-i18n'
import isElectron from 'is-electron'
const ABSOLUTE = useAbsoluteStore()
const PROJECT = useProjectStore()
const editor = useEditor()
const env = useEnv()
const { t } = useI18n()
</script>
3 changes: 1 addition & 2 deletions src/components/material/InputBoolean.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</template>

<script setup lang="ts">
import { ref, computed } from 'vue'
import { computed } from 'vue'
const props = defineProps({
modelValue: {
Expand All @@ -43,7 +43,6 @@
})
const emit = defineEmits(['update:modelValue'])
const inp = ref<HTMLElement | null>(null as any)
const cmp = computed({
get() {
return props.modelValue
Expand Down
2 changes: 1 addition & 1 deletion src/components/material/InputText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
})
const emit = defineEmits(['update:modelValue'])
const inp = ref<HTMLElement | null>(null as any)
const inp = ref<HTMLElement | null>(null)
const cmp = computed({
get() {
return props.modelValue
Expand Down
3 changes: 0 additions & 3 deletions src/pages/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

<script setup lang="ts">
import { setTheme } from '@/plugin/theme/external'
import { ThemeNormalize } from '@/plugin/theme/utils'
import { useContextStore } from '@/store/context'
import { useEditorStore } from '@/store/editor'
import { useProjectStore } from '@/store/project'
import { useEntity } from '@/use/entity'
import { useEnv } from '@/use/env'
Expand All @@ -26,7 +24,6 @@
const PROJECT = useProjectStore()
const CONTEXT = useContextStore()
const EDITOR = useEditorStore()
const keyboard = useKeyboard()
const env = useEnv()
Expand Down

0 comments on commit 3abba7e

Please sign in to comment.