Configure tsconfig.json for Figma typings
masterBecause Figma plugin typings are installed in ./node_modules/@figma rather than the standard ./node_modules/@types directory, you must update your tsconfig.json to include the @figma path in typeRoots. This ensures the TypeScript compiler can locate the definitions. Once configured, the Figma API types will be globally available without requiring explicit import statements, reflecting how the API exists in the Figma host environment.
{
"compilerOptions": {
"typeRoots": [
"./node_modules/@types",
"./node_modules/@figma"
]
}
}