diff --git a/types/simpl-schema/index.d.ts b/types/simpl-schema/index.d.ts index 8ac1a04cc7..afd841e0c9 100644 --- a/types/simpl-schema/index.d.ts +++ b/types/simpl-schema/index.d.ts @@ -34,20 +34,25 @@ interface CustomValidationContext { operator: any; validationContext: ValidationContext; - /** Use this method to get information about other fields. Pass a field name - (non-generic schema key) as the only argument. The return object will - have isSet, value, and operator properties for that field. */ + /** + * Use this method to get information about other fields. Pass a field name + * (non-generic schema key) as the only argument. The return object will + * have isSet, value, and operator properties for that field. + */ field(): any; - - /** Use this method to get information about other fields that have the same - parent object. Works the same way as field(). This is helpful when you use - sub-schemas or when you're dealing with arrays of objects. */ + /** + * Use this method to get information about other fields that have the same + * parent object. Works the same way as field(). This is helpful when you use + * sub-schemas or when you're dealing with arrays of objects. + */ siblingField(): any; - /** Call this to add validation errors for any key. In general, you should use - this to add errors for other keys. To add an error for the current key, - return the error type string. If you do use this to add an error for the - current key, return false from your custom validation function. */ + /** + * Call this to add validation errors for any key. In general, you should use + * this to add errors for other keys. To add an error for the current key, + * return the error type string. If you do use this to add an error for the + * current key, return false from your custom validation function. + */ addValidationErrors(errors: SimpleSchemaValidationError): any; } @@ -64,10 +69,11 @@ interface SchemaDefinition { exclusiveMax?: boolean; exclusiveMin?: boolean; regEx?: RegExp | RegExp[]; - - /** For custom validation function. If you use an arrow function the context - for "this" will not be available. Use "custom: function() { return - something(this.value); }" instead. */ + /** + * For custom validation function. If you use an arrow function the context + * for "this" will not be available. Use "custom: function() { return + * something(this.value); }" instead. + */ custom?: (this: CustomValidationContext) => undefined | string | SimpleSchemaValidationError; blackbox?: boolean; autoValue?: () => any; diff --git a/types/simpl-schema/simpl-schema-tests.ts b/types/simpl-schema/simpl-schema-tests.ts index 55be71ec6e..a3555c4428 100644 --- a/types/simpl-schema/simpl-schema-tests.ts +++ b/types/simpl-schema/simpl-schema-tests.ts @@ -24,7 +24,7 @@ const StringSchema = new SimpleSchema({ const text = this.value; if (text.length > 100) return { type: SimpleSchema.ErrorTypes.MAX_STRING, max: 100 }; - else if (text.length <10) return SimpleSchema.ErrorTypes.MIN_STRING + else if (text.length < 10) return SimpleSchema.ErrorTypes.MIN_STRING; } } }); diff --git a/types/simpl-schema/tslint.json b/types/simpl-schema/tslint.json index 3db14f85ea..3043773b06 100644 --- a/types/simpl-schema/tslint.json +++ b/types/simpl-schema/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "object-literal-shorthand": false + } +}