Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validators should return AbstractValidators with nodev12 #349

Closed
zannkukai opened this issue Feb 5, 2021 · 0 comments · Fixed by #350
Closed

Validators should return AbstractValidators with nodev12 #349

zannkukai opened this issue Feb 5, 2021 · 0 comments · Fixed by #350
Assignees

Comments

@zannkukai
Copy link
Contributor

Describe the issue
When the RERO-ILS-UI linting is running, some warnings are raised due to Validator classes

WARNING: 89:20   deprecation  group is deprecated: This API is not typesafe and can result in issues with Closure Compiler renaming.
Use the `FormBuilder#group` overload with `AbstractControlOptions` instead.
Note that `AbstractControlOptions` expects `validators` and `asyncValidators` to be valid
validators. If you have custom validators, make sure their validation function parameter is
`AbstractControl` and not a sub-class, such as `FormGroup`. These functions will be called with
an object of type `AbstractControl` and that cannot be automatically downcast to a subclass, so
TypeScript sees this as an error. For example, change the `(group: FormGroup) =>
ValidationErrors|null` signature to be `(group: AbstractControl) => ValidationErrors|null`.

We should change the signature for all validators

@zannkukai zannkukai self-assigned this Feb 5, 2021
zannkukai added a commit to zannkukai/ng-core that referenced this issue Feb 5, 2021
Closes rero#349

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
sebdeleze pushed a commit that referenced this issue Feb 10, 2021
Closes #349

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant