[Enhancement] Enable strictTemplate checks #1985
Labels
enhancement
New feature or request
👶🏻 New
For new issues before prioritisation and refinement
NOT Prioritized
Issue not yet prioritized and added to a Milestone
NOT Tech refined
Needs Tech kickoff - solution outlined and agreed
Describe the enhancement
The
fullTemplateTypeCheck
flag that we are using in our library configuration (tsconfig.lib.json) will be deprecated in Angular 13, and be replaced by thestrictTemplates
flag.With this check enabled in our current repo, we will see errors where we try to use strings for inputs that are actually typed, e.g. 'sm' for the size parameter on the button, that has the type ButtonSize.
Same goes for ThemeColor, other sizes like AvatarSize and so on.
I think in many of these cases, it should be possible to use a string as input value, but that is not possible if we or any projects enable the strictTemplates flag, which will probably be the case for almost everyone when upgrading to Angular 13.
Describe the solution you'd like
Change the enum to a string union-type or a union of strings and the specific size/themecolor enums that already exist.
Beware of breaking changes in this regard.
Have you considered any alternatives?
Are there any additional context?
Checklist:
The following tasks should be carried out in sequence in order to follow the process of contributing correctly.
Refinement
Implementation
The contributor who wants to implement this issue should:
Review
Once the issue has been implemented and is ready for review:
The text was updated successfully, but these errors were encountered: