Skip to content

Tool Kit development best practices

Kara Brightwell edited this page Jun 16, 2021 · 1 revision

⚠️ incomplete, please add things

error handling

  • don't throw an error when something is "wrong" with configuration but you know what the user meant
  • when you do throw an error, make sure it explains how to fix it
  • if multiple things are erroring, collect them into a single error. users should never fix an error only to run into another error

plugin authoring

  • plugins are for setting common use cases. if you're wrapping another library, don't be tempted to expose all its configuration through Tool Kit. work out what the common FT.com use case is, and have the plugin do that.
  • plugins should only use options when there's something that can't be inferred from the environment, and must be explicitly provided by the app
Clone this wiki locally