sketch-hq / sketch-assistants

Monorepo containing the official Sketch Assistants, along with utility functions and types for Sketch Assistant development.
MIT License
45 stars 11 forks source link

Drop `default` from option creators #194

Closed christianklotz closed 2 years ago

christianklotz commented 3 years ago

Working with Assistants it feels redundant to declare a default value with the various option creators such as in:

https://github.com/sketch-hq/sketch-assistants/blob/3e354fcf7c7e212bfe6f6dd85bd5c0fc23631d21/packages/types/src/types.ts#L798-L805

They are not used, plus all options are treated as required in the buildRuleOptionSchema API:

https://github.com/sketch-hq/sketch-assistants/blob/3e354fcf7c7e212bfe6f6dd85bd5c0fc23631d21/packages/utils/src/rule-option-schemas/index.ts#L45

Further, the new buildAssistantConfigSchema API derives the default value from the option value provided by an Assistant's configuration.

I propose to drop the (already optional) defaultValue param in all of the option creators.