Skip to content

Commit

Permalink
frontend: add simple part of vue/vue3-recommended rules
Browse files Browse the repository at this point in the history
Turn off the following rules for now:
"vue/no-deprecated-dollar-scopedslots-api": "off",
"vue/no-deprecated-slot-attribute": "off",
"vue/no-deprecated-slot-scope-attribute": "off",
because i could not get the new syntax to work.

That we are ready for vue3 as soon as the calendar works.
Issue: ecamp#5121
  • Loading branch information
BacLuc committed May 12, 2024
1 parent 690f237 commit 2f7027b
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 21 deletions.
11 changes: 11 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
},
"extends": [
"plugin:vue/recommended",
"plugin:vue/vue3-recommended",
"eslint:recommended",
"plugin:prettier/recommended",
"@vue/eslint-config-prettier"
Expand All @@ -143,6 +144,16 @@
}
],
"vue/multi-word-component-names": "off",
"vue/no-deprecated-dollar-listeners-api": "warn",
"vue/no-deprecated-dollar-scopedslots-api": "off",
"vue/no-deprecated-filter": "warn",
"vue/no-deprecated-props-default-this": "warn",
"vue/no-deprecated-slot-attribute": "off",
"vue/no-deprecated-slot-scope-attribute": "off",
"vue/no-deprecated-v-on-native-modifier": "warn",
"vue/no-v-for-template-key-on-child": "warn",
"vue/no-v-model-argument": "warn",
"vue/require-explicit-emits": "off",
"no-unused-vars": [
"error",
{
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default {
}
}
},
destroyed() {
unmounted() {
window.removeEventListener('offline', this.offlineListener)
window.removeEventListener('online', this.onlineListener)
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/activity/DraggableContentNodes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default {
},
},
},
beforeDestroy() {
beforeUnmount() {
this.cleanupDrag()
},
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default {
document.documentElement.addEventListener('touchcancel', this.mouseUp, true)
document.documentElement.addEventListener('touchstart', this.mouseUp, true)
},
beforeDestroy: function () {
beforeUnmount: function () {
document.documentElement.removeEventListener('mousemove', this.mouseMove)
document.documentElement.removeEventListener('mouseup', this.mouseUp)
document.documentElement.removeEventListener('mouseleave', this.mouseUp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
:item-key="key"
:layout-mode="layoutMode"
@delete="deleteItem"
@moveDown="moveDown"
@moveUp="moveUp"
@move-down="moveDown"
@move-up="moveUp"
/>
<StoryboardRowDense
v-else-if="variant === 'dense'"
Expand All @@ -32,8 +32,8 @@
:item-key="key"
:layout-mode="layoutMode"
@delete="deleteItem"
@moveDown="moveDown"
@moveUp="moveUp"
@move-down="moveDown"
@move-up="moveUp"
/>
</template>
</draggable>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/form/base/BasePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export default {
this.setValue(this.value)
},
beforeDestroy() {
beforeUnmount() {
if (this.clickOutsideHandler) {
document.removeEventListener('click', this.clickOutsideHandler)
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/form/base/EColorPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Displays a field as a color picker (can be used with v-model)
v-for="swatch in swatches"
:key="swatch"
:color="swatch"
@selectColor="picker.onInput"
@select-color="picker.onInput"
/>
</div>
</v-card>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/form/base/EDatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Displays a field as a date picker (can be used with v-model)
>
<template #default="picker">
<v-date-picker
:picker-date="pickerMonth"
:value="picker.value || ''"
:locale="$i18n.locale"
first-day-of-week="1"
Expand All @@ -29,7 +30,6 @@ Displays a field as a date picker (can be used with v-model)
no-title
scrollable
show-adjacent-months
:picker-date.sync="pickerMonth"
@input="picker.onInput"
>
<v-spacer />
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/generic/DetailPane.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<DialogBottomSheet
v-if="$vuetify.breakpoint.smAndDown"
:saving-override.sync="isSaving"
:saving-override="isSaving"
:value="value"
v-bind="{ ...$props, ...$attrs }"
v-on="$listeners"
Expand All @@ -13,9 +13,9 @@
</DialogBottomSheet>
<DialogForm
v-else
:saving-override="isSaving"
content-class="ec-dialog-form"
eager
:saving-override.sync="isSaving"
:value="value"
v-bind="{ ...$props, ...$attrs }"
v-on="$listeners"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/navigation/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<v-navigation-drawer
v-if="$vuetify.breakpoint.smAndUp"
v-model="drawer"
:mini-variant="mini"
app
clipped
permanent
:temporary="!mini && !$vuetify.breakpoint.mdAndUp"
:mini-variant.sync="mini"
mini-variant-width="40"
:width="$vuetify.breakpoint.xl || (!mini && !$vuetify.breakpoint.mdAndUp) ? 350 : 256"
:color="!title || mini ? 'blue-grey lighten-4' : null"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/program/ScheduleEntries.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ref="dialogActivityCreate"
:period="period"
:schedule-entry="newScheduleEntry"
@activityCreated="afterCreateActivity($event)"
@activity-created="afterCreateActivity($event)"
/>

<v-btn
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/program/picasso/Picasso.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ Listing all given activity schedule entries in a calendar view.
<PicassoEntry
:schedule-entry="event"
:editable="editable"
@startResize="startResize(event)"
@finishEdit="reloadScheduleEntries"
@start-resize="startResize(event)"
@finish-edit="reloadScheduleEntries"
/>
</template>
</v-calendar>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/program/picasso/PicassoEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
v-if="isEditable"
ref="editDialog"
:schedule-entry="scheduleEntry"
@activityUpdated="$emit('finishEdit')"
@activity-updated="$emit('finishEdit')"
@error="$emit('finishEdit')"
>
<template #activator="{ on }">
Expand Down Expand Up @@ -265,7 +265,7 @@ export default {
this.scrollHeight = this.$el.scrollHeight
window.addEventListener('resize', this.onResize)
},
destroyed() {
unmounted() {
window.removeEventListener('resize', this.onResize)
},
methods: {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/activity/SideBarProgram.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:camp="camp"
:day-selection="daySelection"
:loading="slotProps.loading"
@changeDay="selectedDay = $event"
@change-day="selectedDay = $event"
/>
<v-divider />
<v-skeleton-loader v-if="slotProps.loading" class="mx-1" type="list-item@6" />
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/camp/CampProgram.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ Show all activity schedule entries of a single period.
:end="period.end"
:editable="editMode"
:is-filter-set="isFilterSet"
@newEntry="slotProps.on.newEntry"
@unlockReminder="showUnlockReminder"
@new-entry="slotProps.on.newEntry"
@unlock-reminder="showUnlockReminder"
/>
</template>
</ScheduleEntries>
Expand Down

0 comments on commit 2f7027b

Please sign in to comment.