Post strictPropertyInitialization flag flip cleanup #24571
Comments
|
@rkirov when an input is required, would you mark with a band And seeing the comment from @mhevery in #21571 it seems that we are on the same page;
Truth to the told I am not a particular fan of using the |
|
If you want to have required semantics for your Inputs what we have been recommending is The general advice for I have an additional advice on cleaning up after my change specifically for angular components. For Angular componentsFor angular components, use the following rules in deciding between:
|
|
Thanks for the detailed explanation much appreciated. I quite like what you suggest above. |
When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See angular#24571
When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See angular#24571
When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See angular#24571
When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See angular#24571
When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See angular#24571
When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See angular#24571
When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See angular#24571
When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See angular#24571
When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See angular#24571
When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See angular#24571
When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See angular#24571
When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See angular#24571
When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See angular#24571
When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See #24571 PR Close #28055
…lar#28055) When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See angular#24571 PR Close angular#28055
…lar#28055) When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See angular#24571 PR Close angular#28055
…) (#28736) When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. This commit resolves this problem correctly and removes the hacks. Also the comment ``` // Note: this is always lowercase! ``` has been removed as it is no longer true. See #24571 PR Close #28055 PR Close #28736
|
Hi, I am fairly new to Github but would like to help out, I see a lot of files that have |
QueryList#first and QueryList#last can both sensibly be undefined if the QueryList doesn't match anything. relates angular#24571 Signed-off-by: Ingo Bürk <admin@airblader.de>
QueryList#first and QueryList#last can both sensibly be undefined if the QueryList doesn't match anything. relates angular#24571 Signed-off-by: Ingo Bürk <admin@airblader.de>
|
https://mariusschulz.com/blog/typescript-2-7-strict-property-initialization#solution-4-definite-assignment-assertion has some detailed explanations of this feature and how to use “Definite Assignment Assertion” (i.e. I do think that we should prioritize cleaning up these comments, and “doing the proper thing” in each case, as it looks unprofessional in the docs (for 12+ months). But of course, it’s not as high of a priority as Ivy… It seems like this might be something where the community in general, a GDE, or an Angular Collaborator may be able to help out. There are around 563 occurrences that need to be individually inspected and refactored |
`nodeModulesPath` is now initialized in the constructor, so there is no need for a non-null assertion as suggested in angular#24571.
…ber (angular#32666) `nodeModulesPath` is now initialized in the constructor, so there is no need for a non-null assertion as suggested in angular#24571. PR Close angular#32666
…gular#36805) When we added the strict null checks, the lexer had some `!` operators added to prevent the compilation from failing. See angular#24571 PR Close angular#36805

I'm submitting a...
[x] Other... Please describe: Tracking issue for internal cleanup.
What needs to be done
In order to quickly turn on strictPropertyInitialization flag in the whole code base, we introduced
!on every non-initialized class field. Each one of those fields needs to be individually checked and decided whether:foo!: string, should becomefoo = 'default'.foo!: string, should becomefoo?: string.!should be kept.The text was updated successfully, but these errors were encountered: