Analyzer warnings occur in unexpected context Expected behavior UNT0014 should not triggers if T from GetComponent call refers to generic type parameter, which has Component constraint. Additional ...
In your example, the Enemy script would be a Unity Component, so it would not raise UNT0014. UNT0014 only applies to non-Unity Components. In the screenshot below I created a int i = GetComponent<int> ...