I'm new to TS and JS.
Now I'm trying to set up my first plugin using the guide on macOS.
At some point I got an error:
/code.ts:9:1 - error TS2304: Cannot find name 'figma'.
I followed all the steps from the guide
I suppose the next action in the Terminal.app should have solved the problem, but it did not
sudo npm install --save-dev @figma/plugin-typings
Password:
npm WARN saveError ENOENT: no such file or directory, open '/Users/username/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/username/package.json'
npm WARN username No description
npm WARN username No repository field.
npm WARN username No README data
npm WARN username No license field.
+ @figma/[email protected]
updated 1 package and audited 1 package in 2.72s
found 0 vulnerabilities
The first line of "*.ts" code(except comments) looks like:
figma.showUI(__html__);
I write C++, Swift, Objective-C, some Java a lot and there are some include/import statements. But here is none. I don't know how to deal with it in TS at the moment. =(
PS Thanks for your time