Skip to content

Function: createScopedRuleBuilder() ​

ts
function createScopedRuleBuilder(idOrSource, options?): ScopedRuleBuilder;

Defined in: builders/create-scoped-rule-builder.ts:19

Creates a fluent ScopedRuleBuilder for P.scopedRule(idOrSource).

Delegates to buildScopedRuleFromState to support both inline scoped rules and frontmatter-sourced scoped rule definitions.

Parameters ​

ParameterTypeDescription
idOrSource| string | MaybeBuilder<SourceASTNode<{ checks: BuiltInCheckASTNode<unknown>[]; directive: string; id: string; when: { effects?: FsGlobMatcherNode; partitions: string[]; }; }>>String identifier or frontmatter rule source.
options?CreateScopedRuleBuilderStateOptional internal copy-on-write state.

Returns ​

ScopedRuleBuilder

Frozen ScopedRuleBuilder instance.

Released under the MIT License.