Open eliot-liner opened 1 week ago
Hi @eliot-liner, this is expected behavior.
For now, you can get around this limitation by using string concatenation:
"use strict";
(() => {
// src/index.ts
const IMPORT_STRING = "im" + "port";
figma.codegen.on("generate", () => {
console.log(`${IMPORT_STRING}(`);
return [];
});
})();
@knguyen-figma thanks for answer.
If this were my code, I could change it as you suggested, but it's in the comments in the bundle file of the library I'm using.
The library I am using at runtime is called “prettier”.
And I don't know why this is expected behavior. Shouldn't imports in comments or console logs be excluded from errors?
Hello, Figam Developers.
I am developer of figma codegen (plugin). Thank you for developing this wonderful thing. 🥇
While looking for a place to report, I found a similar Pull Request and am posting the issue here. (ref. https://github.com/figma/plugin-typings/issues/36)
An error occurs if you include
import(
in the bundle file. I run prettier at runtime, but the service terminates unexpectedly due to an alert, so I cannot develop the plugin. Even if it is not a prettier, problems can occur in major libraries.example bundle file
If you do not understand the situation, please ask a question. I would appreciate it if you could fix it :)