mikaelvesavuori / figmagic

Figmagic is the missing piece between DevOps and design: Generate design tokens, export graphics, and extract design token-driven React components from your Figma documents.
https://docs.figmagic.com
MIT License
807 stars 71 forks source link

add length verification to getIds #144

Closed opauloh closed 2 years ago

opauloh commented 2 years ago

1. Context:

If we have a Graphics page that is not empty, but the graphics are not in the root level, we get the following error:

Error: Error: Error: Missing one or more of required arguments: "figmaToken", "figmaUrl" when attempting to get data from Figma API!

Because it bypass the first condition check on getId() that checks against an empty array, but the message implies an keys or API error, which makes difficult for the user to debug.

2. Description of the changes made:

3. Screenshots

image

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication