feat: reduce eslint warnings (#2396)
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
Also added `Destructuring the 'props' will cause the value to lose reactivity` as a warning to prepare for the removal of the propsDestructure option in vite. Reviewed-on: #2396 Reviewed-by: konrad <k@knt.li> Co-authored-by: Dominik Pschenitschni <mail@celement.de> Co-committed-by: Dominik Pschenitschni <mail@celement.de>
This commit is contained in:
parent
c6e934bd6b
commit
2004d129c3
@ -46,7 +46,8 @@ module.exports = {
|
||||
'vue/html-indent': ['error', 'tab'],
|
||||
|
||||
// vue3
|
||||
'vue/no-ref-object-destructure': 'error',
|
||||
'vue/no-ref-object-reactivity-loss': 'error',
|
||||
'vue/no-setup-props-reactivity-loss': 'warn', // TODO: switch to error after vite `propsDestructure` is removed
|
||||
},
|
||||
'parser': 'vue-eslint-parser',
|
||||
'parserOptions': {
|
||||
|
@ -73,14 +73,16 @@ export interface BaseButtonProps extends /* @vue-ignore */ HTMLAttributes {
|
||||
}
|
||||
|
||||
export interface BaseButtonEmits {
|
||||
(e: 'click', payload: MouseEvent): void
|
||||
click: [payload: MouseEvent]
|
||||
}
|
||||
|
||||
const {
|
||||
type = BASE_BUTTON_TYPES_MAP.BUTTON,
|
||||
disabled = false,
|
||||
openExternalInNewTab = true,
|
||||
} = defineProps<BaseButtonProps>()
|
||||
withDefaults(defineProps<BaseButtonProps>(), {
|
||||
type: BASE_BUTTON_TYPES_MAP.BUTTON,
|
||||
disabled: false,
|
||||
to: undefined,
|
||||
href: undefined,
|
||||
openExternalInNewTab: true,
|
||||
})
|
||||
|
||||
const emit = defineEmits<BaseButtonEmits>()
|
||||
|
||||
|
@ -443,7 +443,7 @@ if (enableDiscardShortcut) {
|
||||
}
|
||||
|
||||
const editor = useEditor({
|
||||
// eslint-disable-next-line vue/no-ref-object-destructure
|
||||
// eslint-disable-next-line vue/no-ref-object-reactivity-loss
|
||||
editable: isEditing.value,
|
||||
extensions: extensions,
|
||||
onUpdate: () => {
|
||||
|
@ -234,11 +234,10 @@ import {useConfigStore} from '@/stores/config'
|
||||
import {useProjectStore} from '@/stores/projects'
|
||||
import type {IProjectView} from '@/modelTypes/IProjectView'
|
||||
|
||||
const props = defineProps({
|
||||
projectId: {
|
||||
default: 0,
|
||||
required: false,
|
||||
},
|
||||
const props = withDefaults(defineProps<{
|
||||
projectId?: IProject['id'],
|
||||
}>(), {
|
||||
projectId: 0,
|
||||
})
|
||||
|
||||
const {t} = useI18n({useScope: 'global'})
|
||||
|
@ -206,6 +206,7 @@ const props = defineProps({
|
||||
required: true,
|
||||
},
|
||||
canWrite: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
})
|
||||
|
@ -56,6 +56,7 @@ const props = defineProps({
|
||||
required: true,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
modelValue: {
|
||||
|
@ -71,6 +71,7 @@ const props = defineProps({
|
||||
default: 0,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
creatable: {
|
||||
|
@ -50,6 +50,7 @@ const props = defineProps({
|
||||
type: Number,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
})
|
||||
|
@ -37,6 +37,7 @@ const props = defineProps({
|
||||
default: 0,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
})
|
||||
|
@ -115,32 +115,32 @@
|
||||
<span class="title">{{ rts.title }}</span>
|
||||
<div class="tasks">
|
||||
<div
|
||||
v-for="t in rts.tasks"
|
||||
:key="t.id"
|
||||
v-for="task in rts.tasks"
|
||||
:key="task.id"
|
||||
class="task"
|
||||
>
|
||||
<div class="is-flex is-align-items-center">
|
||||
<Fancycheckbox
|
||||
v-model="t.done"
|
||||
v-model="task.done"
|
||||
class="task-done-checkbox"
|
||||
@update:modelValue="toggleTaskDone(t)"
|
||||
/>
|
||||
<router-link
|
||||
:to="{ name: route.name as string, params: { id: t.id } }"
|
||||
:class="{ 'is-strikethrough': t.done}"
|
||||
:to="{ name: route.name as string, params: { id: task.id } }"
|
||||
:class="{ 'is-strikethrough': task.done}"
|
||||
>
|
||||
<span
|
||||
v-if="t.projectId !== projectId"
|
||||
v-if="task.projectId !== projectId"
|
||||
class="different-project"
|
||||
>
|
||||
<span
|
||||
v-if="t.differentProject !== null"
|
||||
v-if="task.differentProject !== null"
|
||||
v-tooltip="$t('task.relation.differentProject')"
|
||||
>
|
||||
{{ t.differentProject }} >
|
||||
{{ task.differentProject }} >
|
||||
</span>
|
||||
</span>
|
||||
{{ t.title }}
|
||||
{{ task.title }}
|
||||
</router-link>
|
||||
</div>
|
||||
<BaseButton
|
||||
@ -148,7 +148,7 @@
|
||||
class="remove"
|
||||
@click="setRelationToDelete({
|
||||
relationKind: rts.kind,
|
||||
otherTaskId: t.id
|
||||
otherTaskId: task.id
|
||||
})"
|
||||
>
|
||||
<icon icon="trash-alt" />
|
||||
@ -225,6 +225,7 @@ const props = defineProps({
|
||||
default: 0,
|
||||
},
|
||||
editEnabled: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
})
|
||||
|
@ -126,7 +126,7 @@ import AbstractMigrationFileService from '@/services/migrator/abstractMigrationF
|
||||
import {formatDateLong} from '@/helpers/time/formatDate'
|
||||
import {parseDateOrNull} from '@/helpers/parseDateOrNull'
|
||||
|
||||
import {MIGRATORS, Migrator} from './migrators'
|
||||
import {MIGRATORS, type Migrator} from './migrators'
|
||||
import {useTitle} from '@/composables/useTitle'
|
||||
import {useProjectStore} from '@/stores/projects'
|
||||
|
||||
@ -150,9 +150,9 @@ const migrationJustStarted = ref(false)
|
||||
|
||||
const migrator = computed<Migrator>(() => MIGRATORS[props.service])
|
||||
|
||||
// eslint-disable-next-line vue/no-ref-object-destructure
|
||||
// eslint-disable-next-line vue/no-ref-object-reactivity-loss
|
||||
const migrationService = shallowReactive(new AbstractMigrationService(migrator.value.id))
|
||||
// eslint-disable-next-line vue/no-ref-object-destructure
|
||||
// eslint-disable-next-line vue/no-ref-object-reactivity-loss
|
||||
const migrationFileService = shallowReactive(new AbstractMigrationFileService(migrator.value.id))
|
||||
|
||||
useTitle(() => t('migrate.titleService', {name: migrator.value.name}))
|
||||
|
@ -52,10 +52,10 @@
|
||||
>
|
||||
<div class="p-2">
|
||||
<SingleTaskInProject
|
||||
v-for="t in tasks"
|
||||
:key="t.id"
|
||||
v-for="task in tasks"
|
||||
:key="task.id"
|
||||
:show-project="true"
|
||||
:the-task="t"
|
||||
:the-task="task"
|
||||
@taskUpdated="updateTasks"
|
||||
/>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user