Skip to content

Commit

Permalink
Merge pull request #128 from flowforge/chore-eslint-rule-increase
Browse files Browse the repository at this point in the history
Increase ESLint Vue.js Requirements
  • Loading branch information
Pezmc authored Mar 9, 2023
2 parents 49e00d5 + 45f01cd commit dc3e97a
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"overrides": [{
"files": "src/**",
"extends": [
"plugin:vue/vue3-strongly-recommended"
"plugin:vue/vue3-recommended"
],
"rules": {
// plugin:vue
Expand Down
6 changes: 3 additions & 3 deletions src/components/Check.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import { CheckIcon } from '@heroicons/vue/outline'
export default {
name: 'ff-check',
components: {
CheckIcon
},
props: {
value: {
default: false,
type: Boolean
}
},
components: {
CheckIcon
}
}
</script>
18 changes: 9 additions & 9 deletions src/components/DialogBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<div class="ff-dialog-container" :class="'ff-dialog-container--' + (open ? 'open' : 'closed')">
<div class="ff-dialog-box">
<div class="ff-dialog-header">{{ header }}</div>
<div class="ff-dialog-content" ref="content">
<div ref="content" class="ff-dialog-content">
<slot></slot>
</div>
<div class="ff-dialog-actions">
<slot name="actions">
<ff-button @click="cancel()" kind="secondary">Cancel</ff-button>
<ff-button @click="confirm()" :kind="kind" :disabled="disablePrimary">{{ confirmLabel }}</ff-button>
<ff-button kind="secondary" @click="cancel()">Cancel</ff-button>
<ff-button :kind="kind" :disabled="disablePrimary" @click="confirm()">{{ confirmLabel }}</ff-button>
</slot>
</div>
</div>
Expand All @@ -18,7 +18,6 @@
<script>
export default {
name: 'ff-dialog',
emits: ['cancel', 'confirm'],
props: {
header: {
type: String,
Expand All @@ -41,16 +40,17 @@ export default {
default: true
}
},
watch: {
open: function () {
this.$refs.content.scrollTop = 0
}
},
emits: ['cancel', 'confirm'],
data () {
return {
open: false
}
},
watch: {
open: function () {
this.$refs.content.scrollTop = 0
}
},
methods: {
show () {
this.open = true
Expand Down
8 changes: 4 additions & 4 deletions src/components/Help.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<span class="ff-help-tooltip ff-icon" v-ff-tooltip:[position]="text">
<span v-ff-tooltip:[position]="text" class="ff-help-tooltip ff-icon">
<QuestionMarkCircleIcon />
</span>
</template>
Expand All @@ -10,6 +10,9 @@ import { QuestionMarkCircleIcon } from '@heroicons/vue/solid'
export default {
name: 'ff-help',
components: {
QuestionMarkCircleIcon
},
props: {
text: {
required: true,
Expand All @@ -19,9 +22,6 @@ export default {
default: 'right',
type: String
}
},
components: {
QuestionMarkCircleIcon
}
}
</script>
10 changes: 5 additions & 5 deletions src/components/KebabMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<DotsVerticalIcon v-if="!open" @click.stop="openOptions()" />
<DotsVerticalIcon v-if="open" @click.stop="closeOptions()" />
<template v-if="open">
<ul class="ff-kebab-options" :class="'ff-kebab-options--' + menuAlign"
v-click-outside="closeOptions"
<ul v-click-outside="closeOptions" class="ff-kebab-options"
:class="'ff-kebab-options--' + menuAlign"
>
<slot></slot>
</ul>
Expand All @@ -20,16 +20,16 @@ import { DotsVerticalIcon } from '@heroicons/vue/solid'
export default {
name: 'ff-kebab-menu',
components: {
DotsVerticalIcon
},
props: {
// eslint-disable-next-line vue/prop-name-casing
'menu-align': {
type: String,
default: 'right'
}
},
components: {
DotsVerticalIcon
},
data () {
return {
open: false
Expand Down
2 changes: 1 addition & 1 deletion src/components/ListItem.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<li class="ff-list-item" :class="[className, this.disabled ? 'disabled' : ''] ">
<li class="ff-list-item" :class="[className, disabled ? 'disabled' : ''] ">
<component :is="icon" />
<label>{{ label }}</label>
</li>
Expand Down
1 change: 1 addition & 0 deletions src/components/Markdown.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<template>
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-html="markdownToHtml"></div>
</template>

Expand Down
10 changes: 5 additions & 5 deletions src/components/NotificationToast.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>
<span class="ff-notification-toast--close">
<XIcon v-if="showClose" @click="close()" />
<div class="countdown-wrapper" v-if="countdown">
<div v-if="countdown" class="countdown-wrapper">
<div class="countdown-pie countdown-spinner" :style="'animation: rota ' + (countdown/1000) + 's linear infinite;'"></div>
<div class="countdown-pie countdown-filler" :style="'animation: fill ' + (countdown/1000) + 's steps(1, end) infinite;'"></div>
<div class="countdown-mask" :style="'animation: mask ' + (countdown/1000) + 's steps(1, end) infinite;'"></div>
Expand All @@ -28,7 +28,9 @@ import { XIcon } from '@heroicons/vue/solid'
export default {
name: 'ff-notification-toast',
emits: ['close'],
components: {
XIcon
},
props: {
message: {
default: null,
Expand All @@ -47,9 +49,7 @@ export default {
type: Boolean
}
},
components: {
XIcon
},
emits: ['close'],
computed: {
showActions: function () {
return this.$slots.actions
Expand Down
58 changes: 29 additions & 29 deletions src/components/data-table/DataTable.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<template>
<div class="ff-data-table">
<div v-if="showOptions" class="ff-data-table--options">
<ff-text-input v-if="showSearch" class="ff-data-table--search" data-form="search"
:placeholder="searchPlaceholder" v-model="filterTerm"
<ff-text-input v-if="showSearch" v-model="filterTerm" class="ff-data-table--search"
data-form="search" :placeholder="searchPlaceholder"
>
<template #icon><SearchIcon /></template>
</ff-text-input>
<div class="ff-data-table--actions" v-if="$slots.actions">
<div v-if="$slots.actions" class="ff-data-table--actions">
<slot name="actions"></slot>
</div>
</div>
Expand All @@ -24,9 +24,9 @@
<!-- Internal div required to have flex w/sorting icons -->
<div>
{{ col.label }}
<SwitchVerticalIcon class="ff-icon ff-icon-sm" v-if="col.sortable && col.key !== sort.key" />
<SortAscendingIcon class="ff-icon ff-icon-sm icon-sorted" v-if="col.sortable && col.key === sort.key && sort.order === 'asc'" />
<SortDescendingIcon class="ff-icon ff-icon-sm icon-sorted" v-if="col.sortable && col.key === sort.key && sort.order === 'desc'" />
<SwitchVerticalIcon v-if="col.sortable && col.key !== sort.key" class="ff-icon ff-icon-sm" />
<SortAscendingIcon v-if="col.sortable && col.key === sort.key && sort.order === 'asc'" class="ff-icon ff-icon-sm icon-sorted" />
<SortDescendingIcon v-if="col.sortable && col.key === sort.key && sort.order === 'desc'" class="ff-icon ff-icon-sm icon-sorted" />
</div>
</ff-data-table-cell>
<ff-data-table-cell v-if="hasContextMenu"></ff-data-table-cell>
Expand Down Expand Up @@ -59,7 +59,7 @@
</slot>
</table>
<div v-if="showLoadMore" class="ff-loadmore">
<span @click="$emit('load-more')" data-action="load-more">Load More...</span>
<span data-action="load-more" @click="$emit('load-more')">Load More...</span>
</div>
</div>
</template>
Expand Down Expand Up @@ -116,7 +116,12 @@ function searchObjectProps (object, searchTerm, searchProps = []) {
export default {
name: 'ff-data-table',
emits: ['update:search', 'load-more', 'row-selected'],
components: {
SearchIcon,
SwitchVerticalIcon,
SortAscendingIcon,
SortDescendingIcon
},
props: {
columns: {
type: Array,
Expand Down Expand Up @@ -163,6 +168,22 @@ export default {
default: 'No Data Found'
}
},
emits: ['update:search', 'load-more', 'row-selected'],
data () {
return {
internalSearch: '',
sort: {
highlightColumn: null,
key: '',
order: 'desc'
},
pagination: {
active: -1,
max: -1
},
orders: ['desc', 'asc']
}
},
computed: {
showOptions: function () {
return this.showSearch || this.$slots.actions
Expand Down Expand Up @@ -221,21 +242,6 @@ export default {
}
}
},
data () {
return {
internalSearch: '',
sort: {
highlightColumn: null,
key: '',
order: 'desc'
},
pagination: {
active: -1,
max: -1
},
orders: ['desc', 'asc']
}
},
methods: {
filterRows (rows) {
const search = this.internalSearch
Expand Down Expand Up @@ -294,12 +300,6 @@ export default {
}
return obj
}
},
components: {
SearchIcon,
SwitchVerticalIcon,
SortAscendingIcon,
SortDescendingIcon
}
}
</script>
12 changes: 6 additions & 6 deletions src/components/form/DropdownOption.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ export default {
type: String
}
},
mounted () {
this.registerOption({
value: this.value,
label: this.label
})
},
methods: {
select () {
this.$parent.value = {
Expand All @@ -27,12 +33,6 @@ export default {
registerOption (option) {
this.$parent.registerOption(option)
}
},
mounted () {
this.registerOption({
value: this.value,
label: this.label
})
}
}
</script>
4 changes: 2 additions & 2 deletions src/components/form/TextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<div class="ff-input ff-text-input" :class="{'ff-input--error': error}">
<slot name="icon"></slot>
<input
ref="input"
:type="type"
:placeholder="placeholder"
:disabled="disabled"
:value="modelValue"
ref="input"
@change="$emit('update:modelValue', $event.target.value)"
@input="$emit('update:modelValue', $event.target.value)"
@blur="$emit('blur')" @keyup.enter="$emit('enter', $evt)"
Expand All @@ -17,7 +17,6 @@
<script>
export default {
name: 'ff-text-input',
emits: ['update:modelValue', 'input', 'blur', 'keyup', 'enter'],
props: {
// broker standard text-input props
disabled: {
Expand Down Expand Up @@ -47,6 +46,7 @@ export default {
default: ''
}
},
emits: ['update:modelValue', 'input', 'blur', 'keyup', 'enter'],
methods: {
focus () {
this.$refs.input?.focus()
Expand Down
4 changes: 2 additions & 2 deletions src/components/tabs/Tabs.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div ref="ff-tabs">
<ul class="ff-tabs" :class="'ff-tabs--' + orientation">
<li v-for="(tab, $index) in tabs" :key="tab.label" @click="selectTab($index)"
class="ff-tab-option transition-fade--color" :class="{'ff-tab-option--active': tab.isActive}"
<li v-for="(tab, $index) in tabs" :key="tab.label" class="ff-tab-option transition-fade--color"
:class="{'ff-tab-option--active': tab.isActive}" @click="selectTab($index)"
>
{{ tab.label }}
</li>
Expand Down

0 comments on commit dc3e97a

Please sign in to comment.