[TS] Enable strict mode (#3136)

This commit is contained in:
Chenlei Hu
2025-03-18 22:57:17 -04:00
committed by GitHub
parent 44edec7ad2
commit a049e9ae2d
64 changed files with 924 additions and 781 deletions

View File

@@ -1,4 +1,3 @@
// @ts-strict-ignore
import { applyTextReplacements } from '@/utils/searchAndReplace'
import { app } from '../../scripts/app'
@@ -17,11 +16,15 @@ app.registerExtension({
// When the SaveImage node is created we want to override the serialization of the output name widget to run our S&R
nodeType.prototype.onNodeCreated = function () {
const r = onNodeCreated
? onNodeCreated.apply(this, arguments)
? // @ts-expect-error fixme ts strict error
onNodeCreated.apply(this, arguments)
: undefined
// @ts-expect-error fixme ts strict error
const widget = this.widgets.find((w) => w.name === 'filename_prefix')
// @ts-expect-error fixme ts strict error
widget.serializeValue = () => {
// @ts-expect-error fixme ts strict error
return applyTextReplacements(app.graph.nodes, widget.value)
}
@@ -32,7 +35,8 @@ app.registerExtension({
const onNodeCreated = nodeType.prototype.onNodeCreated
nodeType.prototype.onNodeCreated = function () {
const r = onNodeCreated
? onNodeCreated.apply(this, arguments)
? // @ts-expect-error fixme ts strict error
onNodeCreated.apply(this, arguments)
: undefined
if (!this.properties || !('Node name for S&R' in this.properties)) {