[TS] Enable noUnusedLocals (#3108)

This commit is contained in:
Chenlei Hu
2025-03-17 16:20:56 -04:00
committed by GitHub
parent 9e9459815d
commit 7e66e99c3a
28 changed files with 27 additions and 248 deletions

View File

@@ -174,18 +174,6 @@ const { copyToClipboard } = useCopyToClipboard()
const copyReportToClipboard = async () => {
await copyToClipboard(reportContent.value)
}
const openNewGithubIssue = async () => {
await copyReportToClipboard()
const issueTitle = encodeURIComponent(
`[Bug]: ${props.error.exception_type} in ${props.error.node_type}`
)
const issueBody = encodeURIComponent(
'The report has been copied to the clipboard. Please paste it here.'
)
const url = `https://github.com/${repoOwner}/${repoName}/issues/new?title=${issueTitle}&body=${issueBody}`
window.open(url, '_blank')
}
</script>
<style scoped>

View File

@@ -18,13 +18,10 @@
<script setup lang="ts">
import Message from 'primevue/message'
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import { components } from '@/types/comfyRegistryTypes'
import { VueSeverity } from '@/types/primeVueTypes'
const { t } = useI18n()
type PackVersionStatus = components['schemas']['NodeVersionStatus']
type PackStatus = components['schemas']['NodeStatus']
type Status = PackVersionStatus | PackStatus

View File

@@ -87,7 +87,7 @@ const canvasEventHandler = (event: LiteGraphCanvasEvent) => {
}
const group: LGraphGroup = event.detail.group
const [x, y] = group.pos
const [_, y] = group.pos
const e = event.detail.originalEvent
const relativeY = e.canvasY - y
@@ -101,7 +101,7 @@ const canvasEventHandler = (event: LiteGraphCanvasEvent) => {
}
const node: LGraphNode = event.detail.node
const [x, y] = node.pos
const [_, y] = node.pos
const e = event.detail.originalEvent
const relativeY = e.canvasY - y

View File

@@ -165,26 +165,14 @@ const emit = defineEmits<{
const backgroundColor = ref(props.backgroundColor)
const showGrid = ref(props.showGrid)
const showPreview = ref(props.showPreview)
const colorPickerRef = ref<HTMLInputElement | null>(null)
const lightIntensity = ref(props.lightIntensity)
const upDirection = ref(props.upDirection || 'original')
const materialMode = ref(props.materialMode || 'original')
const showLightIntensity = ref(false)
const showLightIntensityButton = ref(props.showLightIntensityButton)
const fov = ref(props.fov)
const showFOV = ref(false)
const showFOVButton = ref(props.showFOVButton)
const showPreviewButton = ref(props.showPreviewButton)
const hasBackgroundImage = ref(props.hasBackgroundImage)
const upDirections: UpDirection[] = [
'original',
'-x',
'+x',
'-y',
'+y',
'-z',
'+z'
]
const edgeThreshold = ref(props.edgeThreshold)
const switchCamera = () => {
@@ -196,10 +184,6 @@ const togglePreview = () => {
emit('togglePreview', showPreview.value)
}
const updateBackgroundColor = (color: string) => {
emit('updateBackgroundColor', color)
}
const handleToggleGrid = (value: boolean) => {
emit('toggleGrid', value)
}
@@ -228,22 +212,10 @@ const handleUpdateLightIntensity = (value: number) => {
emit('updateLightIntensity', value)
}
const updateLightIntensity = () => {
emit('updateLightIntensity', lightIntensity.value)
}
const handleUpdateFOV = (value: number) => {
emit('updateFOV', value)
}
const updateFOV = () => {
emit('updateFOV', fov.value)
}
const updateEdgeThreshold = () => {
emit('updateEdgeThreshold', edgeThreshold.value)
}
const closeSlider = (e: MouseEvent) => {
const target = e.target as HTMLElement

View File

@@ -60,7 +60,7 @@ const confirm = useConfirm()
const taskStore = useMaintenanceTaskStore()
// Properties
const props = defineProps<{
defineProps<{
displayAsList: string
filter: MaintenanceFilter
isRefreshing: boolean

View File

@@ -202,7 +202,7 @@ const canvasEventHandler = (e: LiteGraphCanvasEvent) => {
handleCanvasEmptyRelease(e)
} else if (e.detail.subType === 'group-double-click') {
const group = e.detail.group
const [x, y] = group.pos
const [_, y] = group.pos
const relativeY = e.detail.originalEvent.canvasY - y
// Show search box if the click is NOT on the title bar
if (relativeY > group.titleHeight) {

View File

@@ -136,7 +136,6 @@ import SidebarTabTemplate from '@/components/sidebar/tabs/SidebarTabTemplate.vue
import WorkflowTreeLeaf from '@/components/sidebar/tabs/workflows/WorkflowTreeLeaf.vue'
import { useTreeExpansion } from '@/composables/useTreeExpansion'
import { useWorkflowService } from '@/services/workflowService'
import { useCommandStore } from '@/stores/commandStore'
import { useSettingStore } from '@/stores/settingStore'
import {
useWorkflowBookmarkStore,
@@ -174,7 +173,6 @@ const handleSearch = (query: string) => {
})
}
const commandStore = useCommandStore()
const workflowStore = useWorkflowStore()
const workflowService = useWorkflowService()
const workspaceStore = useWorkspaceStore()

View File

@@ -66,10 +66,6 @@ const sidebarLocation = computed<'left' | 'right'>(() =>
settingStore.get('Comfy.Sidebar.Location')
)
const emit = defineEmits<{
(e: 'toggle-bookmark', value: ComfyNodeDefImpl): void
}>()
const toggleBookmark = () => {
nodeBookmarkStore.toggleBookmark(nodeDef.value)
}

View File

@@ -80,7 +80,6 @@ import { useElementHover } from '@vueuse/core'
import Card from 'primevue/card'
import ProgressSpinner from 'primevue/progressspinner'
import { computed, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import AudioThumbnail from '@/components/templates/thumbnails/AudioThumbnail.vue'
import CompareSliderThumbnail from '@/components/templates/thumbnails/CompareSliderThumbnail.vue'
@@ -101,8 +100,6 @@ const { sourceModule, categoryTitle, loading, template } = defineProps<{
template: TemplateInfo
}>()
const { t } = useI18n()
const cardRef = ref<HTMLElement | null>(null)
const isHovered = useElementHover(cardRef)