-
Notifications
You must be signed in to change notification settings - Fork 60
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
HookMatchCriteria compile error in TypeScript with strict null checks #33
Comments
@christopherthielen Not sure why this was closed - the issue still exists in the current code: export interface HookMatchCriteria {
[key: string]: HookMatchCriterion;
to?: HookMatchCriterion | undefined;
from?: HookMatchCriterion | undefined;
exiting?: HookMatchCriterion | undefined;
retained?: HookMatchCriterion | undefined;
entering?: HookMatchCriterion | undefined;
}
export interface HookMatchCriteria {
[key: string]: HookMatchCriterion | undefined;
to?: HookMatchCriterion;
from?: HookMatchCriterion;
exiting?: HookMatchCriterion;
retained?: HookMatchCriterion;
entering?: HookMatchCriterion;
} |
Also still facing this. |
Same issue here. EDIT: Investigating atm as I'm probably on an older version due to compatibility with the rest of the app. EDIT2: It seems to be an issue even with latest ui-router/core 5.0.4. |
Right now this is the only blocker for me to use the "strict" option. A bit frustrating. |
When is 0ae585e going to be released? I added that patch and everything compiles. |
Chris 🙏 |
New core and angularjs releases tonight |
Compiling a typescript application with strict null checks enabled will produce a number of errors due to the definition of HookMatchCriteria:
This is because the type of the string keyed property (
[key: string]: HookMatchCriterion
) has to match the type any other property in the interface. All other properties are optional, though, and thus of typeHookMatchCriterion | undefined
. Changing the type of the string keyed property toHookMatchCriterion | undefined
resolves the issue.The text was updated successfully, but these errors were encountered: