1
0
Fork 0

Revert "chore: Linting for markdown and js"

This reverts commit 1c92e0f655.
This commit is contained in:
joostdecock 2021-10-17 18:26:00 +02:00
parent 994874fa72
commit cba1ab19c8
6627 changed files with 25791 additions and 24211 deletions

View file

@ -1,8 +1,7 @@
***
---
title: Conditionally loading build-time plugins
order: 30
---------
---
You can choose to load your build-time plugin conditionally based on run-time data.
@ -21,7 +20,6 @@ const condition = settings => {
else return false // Do not load the plugin
}
```
You pass your plugin and condition method as a third parameter to the Design constructor
with the `plugin` and `condition` keys respectively.
@ -52,15 +50,16 @@ const Pattern = new freesewing.Design(
Our condition method will return `true` only if the following conditions are met:
* A `settings` object is passed into the method
* `settings.options` is *truthy*
* `settings.options.draftForHighBust` is *truthy*
* `settings.options.measurements.highBust` is *truthy*
- A `settings` object is passed into the method
- `settings.options` is _truthy_
- `settings.options.draftForHighBust` is _truthy_
- `settings.options.measurements.highBust` is _truthy_
This is a real-world example from our Teagan pattern. A t-shirt pattern that can be
drafted to the high bust (rather than the full chest circumference) if the user
drafted to the high bust (rather than the full chest circumference) if the user
choses so.
But that feat is handled auto-magically by `plugin-bust` which is a build-time plugin.
So whether to load this plugin or not hinges on the user settings, which is why we
load this plugin conditionally.