Skip to content

Conversation

Saanket-Das
Copy link

Ensure figma.loadAllPagesAsync() is supported

This API is not officially documented, and if it doesn’t exist, it will throw an error. You might want to check if it exists before calling it.
figma.ui.postMessage should not use { origin: "*" }

The second argument for figma.ui.postMessage is unnecessary, as it only accepts a single argument in Figma Plugins.
Ensure change.style is defined before accessing .name

You are using change.style?.name, but in some cases, change.style may be undefined. You should check it explicitly.

 Removes { origin: "*" } from figma.ui.postMessage (unnecessary in Figma Plugins).
 Prevents possible undefined access on change.style before accessing .name.
 Uses type !== "STYLE_CREATE" && type !== "STYLE_DELETE" instead of noop for better readability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant