Code analysis are always made on the entire codebase, even though there is only one line changed in a PR. It is not only changed lines that are analyzed, not even changed files, but the entire codebase of the PR.
Then, when reported to SQ, issues which are not in a file changed for a PR are ignored to avoid noise.
So the fact that you don’t see the issue you expect has likely another explanation:
is the rule enabled?
is there really an issue here?
is the analysis running well?
An easy check would be to analyze your PR as it was a brand new project (with a new projectKey, so that you could easily remove it after) and see if the issue is raised or not.
I found the reason, actually sonar fails on scanning ts lint files, with next error
eslint-bridge Node.js process is unresponsive. This is most likely caused by process running out of memory. Consider setting sonar.javascript.node.maxspace to higher value (e.g. 4096).