It's preferred to use screen when using the query functions.
// bad
const component = render()
component.getBy()
// good
screen.getBy()
For a first implementation we can verify that the queries used have screen as callee.
This doesn't take the following into account, but it makes the rule simpler.
const screen = render()
screen.getBy