Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce optional strict property checks.
Add the "strictMissingProperties" diagnostic group. While the current "missingProperties" warnings report when a property can't be found on the type or any of its subtypes, when the "strictMissingProperties" diagnostic group is enabled, the type check will report references to properties that are not declared on that type. As the subtype property references are typed as "unknown" this encourages patterns that less frequently into pits of cascading unknowns. The historic "missingProperties" check was implemented they way it was in no small part because of the awkwardness of typing the DOM API (knowning which subclass of Node/Element you are expecting, etc) and it is expected that this will continue to be the case here that it is awkward. Also here, we hack the suppression guard so that "checkTypes" and "missingProperties" include the "strictMissingProperties" warnings when they are used for suppressions. Note this CL lays a solid foundation for these checks but there are two areas of follow up: property assignments and properties of unions types require additional unit tests. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=184007224
- Loading branch information
1 parent
85089d7
commit f14ef90
Showing
5 changed files
with
412 additions
and
122 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.