From 10b2ce6ee753f5e0ebe1312b9804a28630d204bb Mon Sep 17 00:00:00 2001 From: Denis LE Date: Sat, 3 Apr 2021 14:53:12 +0200 Subject: [PATCH 1/3] Fix missing parenthesis in troubleshooting types --- docs/basic/troubleshooting/types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basic/troubleshooting/types.md b/docs/basic/troubleshooting/types.md index 0b8af4ca..e928d7bc 100644 --- a/docs/basic/troubleshooting/types.md +++ b/docs/basic/troubleshooting/types.md @@ -138,7 +138,7 @@ You can also assert a property is non-null, when accessing it: ```ts element.parentNode!.removeChild(element) // ! before the period -myFunction(document.getElementById(dialog.id!)! // ! after the property accessing +myFunction(document.getElementById(dialog.id!)!) // ! after the property accessing let userID!: string // definite assignment assertion... be careful! ``` From 40858f9a4b5d75707b76318fd00dcf52768fd808 Mon Sep 17 00:00:00 2001 From: Denis LE Date: Sat, 3 Apr 2021 15:12:47 +0200 Subject: [PATCH 2/3] fix prettier --- docs/basic/troubleshooting/types.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/basic/troubleshooting/types.md b/docs/basic/troubleshooting/types.md index e928d7bc..f46da4c9 100644 --- a/docs/basic/troubleshooting/types.md +++ b/docs/basic/troubleshooting/types.md @@ -137,9 +137,9 @@ Note that you cannot assert your way to anything - basically it is only for refi You can also assert a property is non-null, when accessing it: ```ts -element.parentNode!.removeChild(element) // ! before the period -myFunction(document.getElementById(dialog.id!)!) // ! after the property accessing -let userID!: string // definite assignment assertion... be careful! +element.parentNode!.removeChild(element); // ! before the period +myFunction(document.getElementById(dialog.id!)!); // ! after the property accessing +let userID!: string; // definite assignment assertion... be careful! ``` Of course, try to actually handle the null case instead of asserting :) From fed76b80913bca1333a6ad771d2b238bcd2498bd Mon Sep 17 00:00:00 2001 From: swyx Date: Sun, 4 Apr 2021 06:48:04 +0800 Subject: [PATCH 3/3] Update docs/basic/troubleshooting/types.md --- docs/basic/troubleshooting/types.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/basic/troubleshooting/types.md b/docs/basic/troubleshooting/types.md index f46da4c9..e928d7bc 100644 --- a/docs/basic/troubleshooting/types.md +++ b/docs/basic/troubleshooting/types.md @@ -137,9 +137,9 @@ Note that you cannot assert your way to anything - basically it is only for refi You can also assert a property is non-null, when accessing it: ```ts -element.parentNode!.removeChild(element); // ! before the period -myFunction(document.getElementById(dialog.id!)!); // ! after the property accessing -let userID!: string; // definite assignment assertion... be careful! +element.parentNode!.removeChild(element) // ! before the period +myFunction(document.getElementById(dialog.id!)!) // ! after the property accessing +let userID!: string // definite assignment assertion... be careful! ``` Of course, try to actually handle the null case instead of asserting :)