Some browsers (e.g. Safari) will throw an error when getRangeAt
is called and there are no ranges in the selection.
Example of incorrect code for this rule:
window.getSelection().getRangeAt( 0 );
Example of correct code for this rule:
const selection = window.getSelection();
const range = selection.rangeCount ? selection.getRangeAt( 0 ) : null;