Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TemplateValidator

Template validator with a single method validate that, given a set of correlations for a given element, will throw errors for invalid Style correlations. Validator is instantiated with tslint-style validations config.

Validators take the form (str: Set<Style>[], err: (str: string)) => any. The first argument is the list of possible style correlations for an element. The second argument is an error callback function that will throw using the provided error message and include well-formatted location data.

Current built-in validators are:

no-root-classes: Prevent BlockClasses from being applied to the same element is their Root. Enabled by default. no-class-pairs: Prevent two BlockClasses from the same Block from being applied together. Enabled by default. no-attribute-orphans: Prevent an Attribute from being applied without its parent BlockClass or Block. Enabled by default.

param

A hash of tslint-style template validator options.

Hierarchy

  • TemplateValidator

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Private opts

Private validators

validators: Validator[] = []

Methods

validate

Generated using TypeDoc