fix: lint
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2023-05-24 17:15:24 +02:00
parent c1fa64afc7
commit 6da6c6eb20
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
14 changed files with 42 additions and 39 deletions

View File

@ -74,6 +74,7 @@ export interface BaseButtonEmits {
(e: 'click', payload: MouseEvent): void
}
// eslint-disable-next-line vue/no-dupe-keys
const {
type = BASE_BUTTON_TYPES_MAP.BUTTON,
disabled = false,

View File

@ -66,9 +66,9 @@ const props = defineProps({
const emit = defineEmits(['update:modelValue'])
const modelValue = toRef(props, 'modelValue')
const modelValueRef = toRef(props, 'modelValue')
watch(
modelValue,
modelValueRef,
(newValue) => {
color.value = newValue
},

View File

@ -56,6 +56,7 @@ export interface ButtonProps extends BaseButtonProps {
wrap?: boolean
}
// eslint-disable-next-line vue/no-dupe-keys
const {
variant = 'primary',
icon = '',

View File

@ -134,9 +134,9 @@ const changed = ref(false)
onMounted(() => document.addEventListener('click', hideDatePopup))
onBeforeUnmount(() =>document.removeEventListener('click', hideDatePopup))
const modelValue = toRef(props, 'modelValue')
const modelValueRef = toRef(props, 'modelValue')
watch(
modelValue,
modelValueRef,
setDateValue,
{immediate: true},
)

View File

@ -157,10 +157,10 @@ const config = ref(createEasyMDEConfig({
const checkboxId = ref(createRandomID())
const {modelValue} = toRefs(props)
const {modelValue: modelValueRef} = toRefs(props)
watch(
modelValue,
modelValueRef,
async (value) => {
text.value = value
await nextTick()
@ -172,7 +172,7 @@ watch(
text,
(newVal, oldVal) => {
// Only bubble the new value if it actually changed, but not if the component just got mounted and the text changed from the outside.
if (oldVal === '' && text.value === modelValue.value) {
if (oldVal === '' && text.value === modelValueRef.value) {
return
}
bubble()
@ -181,8 +181,8 @@ watch(
onMounted(() => {
if (modelValue.value !== '') {
text.value = modelValue.value
if (modelValueRef.value !== '') {
text.value = modelValueRef.value
}
if (props.previewIsDefault && props.hasPreview) {

View File

@ -227,10 +227,10 @@ const internalValue = ref<string | {[key: string]: any} | any[] | null>(null)
onMounted(() => document.addEventListener('click', hideSearchResultsHandler))
onBeforeUnmount(() => document.removeEventListener('click', hideSearchResultsHandler))
const {modelValue, searchResults} = toRefs(props)
const {modelValue: modelValueRef, searchResults: searchResultsRef} = toRefs(props)
watch(
modelValue,
modelValueRef,
(value) => setSelectedObject(value),
{
immediate: true,
@ -261,10 +261,10 @@ const creatableAvailable = computed(() => {
const filteredSearchResults = computed(() => {
const currentInternal = internalValue.value
if (props.multiple && currentInternal !== null && Array.isArray(currentInternal)) {
return searchResults.value.filter((item: any) => !currentInternal.some(e => e === item))
return searchResultsRef.value.filter((item: any) => !currentInternal.some(e => e === item))
}
return searchResults.value
return searchResultsRef.value
})
const hasMultiple = computed(() => {
@ -392,8 +392,8 @@ function create() {
}
function createOrSelectOnEnter() {
if (!creatableAvailable.value && searchResults.value.length === 1) {
select(searchResults.value[0])
if (!creatableAvailable.value && searchResultsRef.value.length === 1) {
select(searchResultsRef.value[0])
return
}

View File

@ -93,7 +93,7 @@ const emit = defineEmits([
...allEvents.map(camelToKebab),
])
const {modelValue, config, disabled} = toRefs(props)
const {modelValue: modelValueRef, config: configRef, disabled: disabledRef} = toRefs(props)
// bind listener like onBlur
const attrs = useAttrs()
@ -159,7 +159,7 @@ onMounted(() => {
})
onBeforeUnmount(() => fp.value?.destroy())
watch(config, () => {
watch(configRef, () => {
if (!fp.value) return
// Workaround: Don't pass hooks to configs again otherwise
// previously registered hooks will stop working
@ -201,7 +201,7 @@ onBeforeUnmount(() => fpInput.value?.removeEventListener('blur', onBlur))
* Watch for the disabled property and sets the value to the real input.
*/
watchEffect(() => {
if (disabled.value) {
if (disabledRef.value) {
fpInput.value?.setAttribute('disabled', '')
} else {
fpInput.value?.removeAttribute('disabled')
@ -212,7 +212,7 @@ watchEffect(() => {
* Watch for changes from parent component and update DOM
*/
watch(
modelValue,
modelValueRef,
newValue => {
// Prevent updates if v-model value is same as input's current value
if (!root.value || newValue === nullify(root.value.value)) return

View File

@ -255,7 +255,7 @@ const props = defineProps({
const emit = defineEmits(['update:modelValue'])
const {modelValue} = toRefs(props)
const {modelValue: modelValueRef} = toRefs(props)
const labelStore = useLabelStore()
@ -289,7 +289,7 @@ onMounted(() => {
})
watch(
modelValue,
modelValueRef,
(value) => {
// FIXME: filters should only be converted to snake case in
// the last moment

View File

@ -78,7 +78,7 @@ const emit = defineEmits<{
(e: 'update:task', task: ITaskPartialWithId): void
}>()
const {tasks, filters} = toRefs(props)
const {tasks: tasksRef, filters: filtersRef} = toRefs(props)
// setup dayjs for vue-ganttastic
const dayjsLanguageLoading = ref(false)
@ -87,8 +87,8 @@ extendDayjs()
const router = useRouter()
const dateFromDate = computed(() => new Date(new Date(filters.value.dateFrom).setHours(0,0,0,0)))
const dateToDate = computed(() => new Date(new Date(filters.value.dateTo).setHours(23,59,0,0)))
const dateFromDate = computed(() => new Date(new Date(filtersRef.value.dateFrom).setHours(0,0,0,0)))
const dateToDate = computed(() => new Date(new Date(filtersRef.value.dateTo).setHours(23,59,0,0)))
const DAY_WIDTH_PIXELS = 30
const ganttChartWidth = computed(() => {
@ -103,10 +103,10 @@ const ganttBars = ref<GanttBarObject[][]>([])
* Update ganttBars when tasks change
*/
watch(
tasks,
tasksRef,
() => {
ganttBars.value = []
tasks.value.forEach(t => ganttBars.value.push(transformTaskToGanttBar(t)))
tasksRef.value.forEach(t => ganttBars.value.push(transformTaskToGanttBar(t)))
},
{deep: true, immediate: true},
)

View File

@ -39,12 +39,12 @@ const props = defineProps({
},
})
const {task} = toRefs(props)
const {task: taskRef} = toRefs(props)
const updatedSince = computed(() => formatDateSince(task.value.updated))
const updatedFormatted = computed(() => formatDateLong(task.value.updated))
const doneSince = computed(() => formatDateSince(task.value.doneAt))
const doneFormatted = computed(() => formatDateLong(task.value.doneAt))
const updatedSince = computed(() => formatDateSince(taskRef.value.updated))
const updatedFormatted = computed(() => formatDateLong(taskRef.value.updated))
const doneSince = computed(() => formatDateSince(taskRef.value.doneAt))
const doneFormatted = computed(() => formatDateLong(taskRef.value.doneAt))
</script>
<style lang="scss" scoped>

View File

@ -188,17 +188,17 @@ const taskService = shallowReactive(new TaskService())
const task = ref<ITask>(new TaskModel())
const showDefer = ref(false)
const theTask = toRef(props, 'theTask')
const theTaskRef = toRef(props, 'theTask')
watch(
theTask,
theTaskRef,
newVal => {
task.value = newVal
},
)
onMounted(() => {
task.value = theTask.value
task.value = theTaskRef.value
document.addEventListener('click', hideDeferDueDatePopup)
})

View File

@ -77,7 +77,7 @@ const props = defineProps<{route: RouteLocationNormalized}>()
const baseStore = useBaseStore()
const canWrite = computed(() => baseStore.currentProject.maxRight > RIGHTS.READ)
const {route} = toRefs(props)
const {route: routeRef} = toRefs(props)
const {
filters,
hasDefaultFilters,
@ -86,7 +86,7 @@ const {
isLoading,
addTask,
updateTask,
} = useGanttFilters(route)
} = useGanttFilters(routeRef)
const DEFAULT_DATE_RANGE_DAYS = 7

View File

@ -73,6 +73,7 @@ setTimeout(() => showNothingToDo.value = true, 100)
// Linting disabled because we explicitely enabled destructuring in vite's config, this will work.
// eslint-disable-next-line vue/no-setup-props-destructure
// eslint-disable-next-line vue/no-dupe-keys
const {
dateFrom,
dateTo,

View File

@ -536,7 +536,7 @@ const taskColor = ref<ITask['hexColor']>('')
// Used to avoid flashing of empty elements if the task content is not yet loaded.
const visible = ref(false)
const taskId = toRef(props, 'taskId')
const taskIdRef = toRef(props, 'taskId')
const parent = computed(() => {
if (!task.projectId) {
@ -584,7 +584,7 @@ const hasAttachments = computed(() => attachmentStore.attachments.length > 0)
const isModal = computed(() => Boolean(props.backdropView))
function attachmentUpload(file: File, onSuccess?: (url: string) => void) {
return uploadFile(taskId.value, file, onSuccess)
return uploadFile(taskIdRef.value, file, onSuccess)
}
const heading = ref<HTMLElement | null>(null)
@ -595,7 +595,7 @@ async function scrollToHeading() {
const taskService = shallowReactive(new TaskService())
// load task
watch(taskId, async (id) => {
watch(taskIdRef, async (id) => {
if (id === undefined) {
return
}