Skip to content

refactor: fix eslint warnings in the cli-ui codebase #6189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export default {
if (emptySelection) {
this.$_terminal.selectAll()
}
var selection = this.$_terminal.getSelection()
const selection = this.$_terminal.getSelection()
textarea.value = selection
textarea.select()
document.execCommand('copy')
Expand Down
7 changes: 5 additions & 2 deletions packages/@vue/cli-ui/src/components/dashboard/Widget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
<!-- Custom actions -->
<template v-if="widget.configured">
<VueButton
v-for="action of headerActions"
v-if="!action.hidden"
v-for="action of visibleHeaderActions"
:key="action.id"
:icon-left="action.icon"
:disabled="action.disabled"
Expand Down Expand Up @@ -296,6 +295,10 @@ export default {
return this.widget.definition.detailsComponent
}
return this.widget.definition.component
},

visibleHeaderActions () {
return this.headerActions.filter(action => !action.hidden)
}
},

Expand Down
13 changes: 7 additions & 6 deletions packages/@vue/cli-ui/src/components/dashboard/WidgetAddPane.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@
/>

<template v-else-if="data">
<WidgetAddItem
v-for="definition of data.widgetDefinitions.filter(filterDefinition)"
v-if="definition.canAddMore"
:key="definition.id"
:definition="definition"
/>
<template v-for="definition of data.widgetDefinitions.filter(filterDefinition)">
<WidgetAddItem
v-if="definition.canAddMore"
:key="definition.id"
:definition="definition"
/>
</template>
</template>
</template>
</ApolloQuery>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export default {
} else if (this.change.type === 'del') {
return this.change.ln
}

return ''
},

ln2 () {
Expand All @@ -53,6 +55,8 @@ export default {
} else if (this.change.type === 'add') {
return this.change.ln
}

return ''
}
},

Expand Down
15 changes: 8 additions & 7 deletions packages/@vue/cli-ui/src/components/folder/FolderExplorer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,14 @@
/>
</transition>
<template v-if="folderCurrent && folderCurrent.children">
<FolderExplorerItem
v-for="folder of folderCurrent.children"
v-if="showHidden || !folder.hidden"
:key="folder.name"
:folder="folder"
@select="openFolder(folder.path)"
/>
<template v-for="folder of folderCurrent.children">
<FolderExplorerItem
v-if="showHidden || !folder.hidden"
:key="folder.name"
:folder="folder"
@select="openFolder(folder.path)"
/>
</template>
</template>
</div>

Expand Down
17 changes: 9 additions & 8 deletions packages/@vue/cli-ui/src/components/prompt/PromptsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
>
<div v-if="group.id" class="group-name">{{ $t(group.id) }}</div>

<component
v-for="prompt of group.prompts"
v-if="prompt.visible"
:key="prompt.id"
:is="getModule(prompt)"
:prompt="prompt"
@answer="value => $emit('answer', { prompt, value })"
/>
<template v-for="prompt of group.prompts">
<component
v-if="prompt.visible"
:key="prompt.id"
:is="getModule(prompt)"
:prompt="prompt"
@answer="value => $emit('answer', { prompt, value })"
/>
</template>
</div>

<div v-if="!prompts.length" class="vue-ui-empty">
Expand Down
13 changes: 7 additions & 6 deletions packages/@vue/cli-ui/src/components/view/ViewNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
class="vertical small-indicator left-indicator primary"
indicator
>
<ViewNavButton
v-for="view of views"
v-if="hasProjectType(view)"
:key="view.id"
:view="view"
/>
<template v-for="view of views">
<ViewNavButton
v-if="hasProjectType(view)"
:key="view.id"
:view="view"
/>
</template>
</VueGroup>

<ViewNavMore/>
Expand Down
2 changes: 2 additions & 0 deletions packages/@vue/cli-ui/src/components/view/ViewNavButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export default {
if (this.view.badges && this.view.badges.length) {
return this.view.badges.slice().sort((a, b) => b.priority - a.priority)
}

return []
},

firstNotHiddenBadge () {
Expand Down