This repository was archived by the owner on Dec 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 395
build: enable strictTemplates, strictBindCallApply, and strictFunctionTypes #688
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2f63af9
to
5b26e24
Compare
jelbourn
reviewed
Dec 14, 2019
I'm also not really concerned w/ turning on |
5b26e24
to
c3509a9
Compare
crisbeto
approved these changes
Dec 15, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -71,8 +70,12 @@ export class ThemePicker implements OnInit, OnDestroy { | |||
|
|||
ngOnInit() { | |||
this._queryParamSubscription = this._activatedRoute.queryParamMap | |||
.pipe(map((params: ParamMap) => params.get('theme')), filter(Boolean)) | |||
.subscribe((themeName: string) => this.installTheme(themeName)); | |||
.pipe(map((params: ParamMap) => params.get('theme'))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the previous approach was valid, you just needed to do themeName!
since it's guaranteed to be defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this._queryParamSubscription = this._activatedRoute.queryParamMap
.pipe(map((params: ParamMap) => params.get('theme')), filter(Boolean))
.subscribe((themeName: string) => this.installTheme(themeName!));
Results in:
ERROR in src/app/shared/theme-picker/theme-picker.ts:74:16 - error TS2769: No overload matches this call.
Overload 1 of 5, '(observer?: NextObserver<unknown> | ErrorObserver<unknown> | CompletionObserver<unknown> | undefined): Subscription', gave the following error.
Argument of type '(themeName: string) => void' is not assignable to parameter of type 'NextObserver<unknown> | ErrorObserver<unknown> | CompletionObserver<unknown> | undefined'.
Property 'complete' is missing in type '(themeName: string) => void' but required in type 'CompletionObserver<unknown>'.
Overload 2 of 5, '(next?: ((value: unknown) => void) | undefined, error?: ((error: any) => void) | undefined, complete?: (() => void) | undefined): Subscription', gave the following error.
Argument of type '(themeName: string) => void' is not assignable to parameter of type '(value: unknown) => void'.
Types of parameters 'themeName' and 'value' are incompatible.
Type 'unknown' is not assignable to type 'string'.
74 .subscribe((themeName: string) => this.installTheme(themeName!));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/rxjs/internal/types.d.ts:64:5
64 complete: () => void;
~~~~~~~~
'complete' is declared here.
This compiles, but is not great...
.subscribe((themeName: any) => this.installTheme(themeName));
…nTypes - fix related build errors - complete `this._destroyed` in `ngOnDestroy()` - exclude `dist/` from linting
c3509a9
to
8c57c56
Compare
devversion
approved these changes
Dec 16, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this._destroyed
inngOnDestroy()
dist/
from lintingstrictPropertyInitialization
is a bit more problematic, so it will be handled in a separate PR.