And make it more general.
These are present in the netstandard branch (the rules aren't working there - probably using the wrong configuration).
This reverts commit a6d8b28221.
a6d8b28221