Consider alternatives for types on StyleDictionary configuration #11
Labels
code style
Improve the legibility or structure of working code
priority:low
question
Further information is requested
StyleDictionary receives the custom logic of its pipeline (transformer, transform groups, formatters, fileHeaders) on a javascript object. (The object is constructed on
src/style-dictionary/config.ts
)To add custom logic, we must first register it with a name and add a name to the configuration file.
In order to ease the tracking and reuse of these names, we create enum types of the names (
src/style-dictionary/types.ts
).According to the typing convention we are working with, these enums should be string arrays and union types. However, the function in which we use these types (when registering the logic and when creating the config file) both receive any string. So there will be no autocomplete for the developers if we use a union type in those contexts.
Consider if we should use an enum in this case or if we should stick with the enum.
The text was updated successfully, but these errors were encountered: