Linters commonly support placing skip directives on the line preceding some code, which better fits the rest of the comment flow.
For projects that mostly use before-line comments, the current UX is not ideal: SonarQube will silently ignore the comment and continue to report the rule violation anyway. When can we get similar before-line NOSONAR parsing support in SonarQube?
Meanwhile, the official documentation could help to clarify the present syntax requirement. It was not really clear from the literature that SonarQube has only faithfully obeys NOSONAR when specified as a trailing comment.