vscode extension automatically inserts type assertion for tsTypes field in createMachine() for example from
tsTypes: {}
we get
tsTypes: {} as import("./scan.machine.typegen").Typegen0
which is fine for typescript files. I have used this in javascript files (together with jsdoc to specify types) and it seems to work fine, however this automatic insertion in invalid for js files. I have actually used another editor to edit the file with this contents instead:
vscode extension automatically inserts type assertion for
tsTypes
field increateMachine()
for example fromtsTypes: {}
we get
tsTypes: {} as import("./scan.machine.typegen").Typegen0
which is fine for typescript files. I have used this in javascript files (together with jsdoc to specify types) and it seems to work fine, however this automatic insertion in invalid for js files. I have actually used another editor to edit the file with this contents instead:
tsTypes: /** @type {import("./scan.machine.typegen").Typegen0} */ ({})
and after that I could get correct types for actions for example.
It would be nice if vscode extension could check if language of the file is javascript and insert corresponding jsdoc instead of using
as
keyword.