I am using XState on the backend and per the XState docs, I added type annotation to my state machine's config:
export const machine = createMachine(
{
tsTypes: {} as import("./testMachine.server.typegen").Typegen0,
...,
}
However, the type cast is throwing this error:
`import()` type annotations are forbidden.eslint@typescript-eslint/consistent-type-imports
interface Typegen0
I looked into dynamic imports, but that doesn't seem to fix the issue:
const dynamicImport = async() => await import("./testMachine.server.typegen")
This is from my eslint.
It says you MUST import types as
You can read more in the documentation: https://typescript-eslint.io/rules/consistent-type-imports/#prefer