style: apply fixes for eslint issues [cw-3590] (#10210)

These fixes are all auto generated and can be merged directly

Fixes the following issues

1. Event used on components should be hypenated
2. Attribute orders in components
3. Use `unmounted` instead of `destroyed`
4. Add explicit `emits` declarations for components, autofixed [using
this
script](https://gist.github.com/scmmishra/6f549109b96400006bb69bbde392eddf)


We ignore the top level v-if for now, we will fix it later
This commit is contained in:
Shivam Mishra
2024-10-03 15:02:12 +05:30
committed by GitHub
parent b8d0252511
commit c51a458c25
257 changed files with 1013 additions and 310 deletions

View File

@@ -15,6 +15,7 @@ export default {
default: () => [],
},
},
emits: ['view', 'viewAll'],
computed: {
...mapGetters({ widgetColor: 'appConfig/getWidgetColor' }),
},

View File

@@ -8,6 +8,7 @@ export default {
default: () => [],
},
},
emits: ['view', 'viewAll'],
methods: {
onArticleClick(link) {
this.$emit('view', link);
@@ -20,7 +21,7 @@ export default {
<CategoryCard
:title="$t('PORTAL.POPULAR_ARTICLES')"
:articles="articles.slice(0, 6)"
@viewAll="$emit('viewAll')"
@view-all="$emit('viewAll')"
@view="onArticleClick"
/>
</template>

View File

@@ -11,6 +11,7 @@ export default {
default: () => [],
},
},
emits: ['selectArticle'],
data() {
return {};
},

View File

@@ -13,6 +13,7 @@ export default {
default: '',
},
},
emits: ['selectArticle'],
data() {
return {};
},

View File

@@ -7,6 +7,7 @@ export default {
default: '',
},
},
emits: ['search'],
data() {
return {
searchQuery: '',

View File

@@ -23,6 +23,7 @@ export default {
};
</script>
<!-- eslint-disable-next-line vue/no-root-v-if -->
<template>
<div v-if="showBannerMessage" :class="`banner ${bannerType}`">
<span>

View File

@@ -35,7 +35,7 @@ export default {
mounted() {
document.addEventListener('paste', this.handleClipboardPaste);
},
destroyed() {
unmounted() {
document.removeEventListener('paste', this.handleClipboardPaste);
},
methods: {

View File

@@ -76,7 +76,7 @@ export default {
}
},
},
destroyed() {
unmounted() {
document.removeEventListener('keypress', this.handleEnterKeyPress);
},
mounted() {
@@ -149,8 +149,8 @@ export default {
:placeholder="$t('CHAT_PLACEHOLDER')"
class="form-input user-message-input is-focused"
:class="inputColor"
@typingOff="onTypingOff"
@typingOn="onTypingOn"
@typing-off="onTypingOff"
@typing-on="onTypingOn"
@focus="onFocus"
@blur="onBlur"
/>

View File

@@ -17,6 +17,7 @@ export default {
default: 0,
},
},
emits: ['continue'],
};
</script>

View File

@@ -12,6 +12,7 @@ export default {
default: false,
},
},
emits: ['dragged'],
data() {
return {
startX: null,

View File

@@ -10,6 +10,7 @@ export default {
default: () => {},
},
},
emits: ['dismiss'],
computed: {
replyToAttachment() {
if (!this.inReplyTo?.attachments?.length) {

View File

@@ -26,8 +26,8 @@ const activeCountryCode = ref(getActiveCountryCode());
const activeDialCode = ref(getActiveDialCode());
const phoneNumber = ref('');
const dropdownRef = useTemplateRef('dropdown');
const searchbarRef = useTemplateRef('searchbar');
const dropdownRef = useTemplateRef('dropdownRef');
const searchbarRef = useTemplateRef('searchbarRef');
const placeholder = computed(() => context?.attrs?.placeholder || '');
const hasErrorInPhoneInput = computed(() => context.hasErrorInPhoneInput);
@@ -261,7 +261,7 @@ function onSelect() {
</div>
<div
v-if="showDropdown"
ref="dropdown"
ref="dropdownRef"
v-on-clickaway="closeDropdown"
:class="dropdownBackgroundClass"
class="absolute z-10 h-48 px-0 pt-0 pb-1 pl-1 pr-1 overflow-y-auto rounded shadow-lg country-dropdown top-12"
@@ -271,8 +271,8 @@ function onSelect() {
>
<div class="sticky top-0" :class="dropdownBackgroundClass">
<input
ref="searchbarRef"
v-model="searchCountry"
ref="searchbar"
type="text"
:placeholder="$t('PRE_CHAT_FORM.FIELDS.PHONE_NUMBER.DROPDOWN_SEARCH')"
class="w-full h-8 px-3 py-2 mt-1 mb-1 text-sm border border-solid rounded outline-none dropdown-search"

View File

@@ -81,6 +81,7 @@ export default {
};
</script>
<!-- eslint-disable-next-line vue/no-root-v-if -->
<template>
<div v-if="showHeaderActions" class="actions flex items-center">
<button

View File

@@ -5,6 +5,7 @@ export default {
thumb: { type: String, default: '' },
readableTime: { type: String, default: '' },
},
emits: ['error'],
methods: {
onImgError() {
this.$emit('error');

View File

@@ -25,6 +25,7 @@ export default {
default: () => {},
},
},
emits: ['submit'],
setup() {
const phoneInput = createInput(PhoneInput, {
props: ['hasErrorInPhoneInput'],

View File

@@ -7,6 +7,7 @@ export default {
default: '',
},
},
emits: ['search'],
data() {
return {
searchQuery: '',

View File

@@ -26,6 +26,7 @@ export default {
default: false,
},
},
emits: ['startConversation'],
computed: {
...mapGetters({

View File

@@ -20,6 +20,7 @@ export default {
required: true,
},
},
emits: ['close'],
computed: {
...mapGetters({
unreadMessageCount: 'conversation/getUnreadMessageCount',

View File

@@ -21,6 +21,7 @@ export default {
};
</script>
<!-- eslint-disable-next-line vue/no-root-v-if -->
<template>
<div
v-if="!!items.length"
@@ -35,10 +36,9 @@ export default {
class="mr-1"
:class="getThemeClass('text-black-900', 'dark:text-slate-50')"
/>
<span
:class="getThemeClass('text-slate-900', 'dark:text-slate-50')"
>{{ item.title }}</span
>
<span :class="getThemeClass('text-slate-900', 'dark:text-slate-50')">
{{ item.title }}
</span>
</span>
<span
class="description"