Color mode

Search notes

Filter with tag:, lang:, or path:.

Plugin options

Plugin options are configuration values passed to a plugin factory; they are validated through a pure validateOptions function with no side effects, and the resolved options are available on the plugin options property.

Option validation

ts
type ExampleOptions = {
  enabled?: boolean;
};
 
export function example(options: ExampleOptions = {}) {
  return definePlugin({
    name: "example",
    options,
  });
}

Validator contract

Validators must have no side effects โ€” no filesystem scanning, no builds, no cache writes, and no modification of external state. Return problems as structured issues. The validator type is PluginOptionsValidator<TOptions> which takes options and returns readonly Issue[] | void.

Learn more

Local Graph

Nearby Notes

Open in Explorer โ†’
Plugin optionsConfigPlugin
CurrentOutgoingBacklink