Added new feature to disable base class checking #841
Merged
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.
Description
Added an option to the container to skip checking base classes for @Injectable classes.
Related Issue
These issues are all related to this particular problem, but are most likely using workarounds:
#528
#297
#729
This issue is still open, and quite accurately explains why this feature is desirable:
#522
Motivation and Context
This change is a simple quality of life fix for those who are creating injectable
classes by extending classes provided by third parties. The only reason this check is
currently in place is to assist developers who may forget to call
super()
with the correctarguments to instantiate the parent class. For those developers who wish to forgo those built
in checks, this options should save them the trouble of decorating all parent
classes with @injectable/@Unmanaged (since this quite tedious, and may cause unforseen problems
with 3rd party libraries).
How Has This Been Tested?
I have added a simple test in the planner test file, and have run the rest of the test suite.
It behaves as expected without the option (throws an error on base classes that are not @Injectable), and behaves as expected with the option.
Types of changes
Checklist: