-
-
Notifications
You must be signed in to change notification settings - Fork 598
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
Apply more strict typescript around the codebase #2778
Conversation
…chguy/tsc-strict2 � Conflicts: � src/sync.ts
Increases overall coverage from 67.6% to 68% - infeasible to hit 80% mark with this typing fix. |
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.
Looks reasonable to me, left a couple small questions.
@@ -109,10 +109,10 @@ export class UnstableValue<S extends string, U extends string> extends Namespace | |||
} | |||
|
|||
public get name(): U { | |||
return this.unstable; | |||
return this.unstable!; |
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.
Should be U | undefined
return type rather than non-null assertion
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.
The constructor says
// Stable is optional, but one of the two parameters is required, hence the weird-looking types.
// Goal is to to have developers explicitly say there is no stable value (if applicable).
So we can assert it will be defined given the stable
wasn't. Will try express it with an overload
@@ -685,14 +686,6 @@ export class MatrixEvent extends TypedEventEmitter<MatrixEventEmittedEvents, Mat | |||
* attempt is completed. | |||
*/ | |||
public async attemptDecryption(crypto: Crypto, options: IDecryptOptions = {}): Promise<void> { | |||
// For backwards compatibility purposes |
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.
Should this qualify as a breaking change even though the signature is unchanged?
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.
The type didn't allow for the backwards compatibility so it got partially removed at some point in the past
Requires matrix-org/matrix-react-sdk#9474
This change is marked as an internal change (Task), so will not be included in the changelog.