Context Based Property Documentation | Task

Ole Ersoy
Nov - 06  -  1 min

Scenario

Within the @fireflysemantics/validator interface ValidationOptions we have the property:

skipErrorGeneration?:boolean 

And we wish to provide a comment reflecting the context for the use of this property, such that API developers and users can understand the purpose of the property.

Approach

We provide a description for the properties use within a single context:

//=====================================
// For @IsDefined we want to allow
// users to skip error generation in the 
// event that the validation should not 
// proceed when the property is not
// defined.
//=====================================
skipErrorGeneration?:boolean