Improvement identified in #2790.
Add a prefix to the diff-id when it is used multiple times in different
"how to fix it in XYZ" sections to avoid ambiguity and pedantically
follow the spec:
> A single and unique diff-id should be used only once for each type of
code example as shown in the description of a rule.
Obvious typos around `diff-type` were fixed.
An obvious extra use of diff blocks was removed.
I couldn't get Sonarcloud to trigger this issue using the provided
noncompliant code example.
I think the code examples as written end up being circular because the
local function 'redirect()' will call itself rather than the imported
'redirect()' function of the same name. The fix is to change the local
function name to be redirecting(). I changed the API endpoint name as
well so that it matched. Once I had made this change, the noncompliant
code example did lead to Sonarcloud spotting the issue.
## Review
A dedicated reviewer checked the rule description successfully for:
- [x] logical errors and incorrect information
- [x] information gaps and missing content
- [x] text style and tone
- [x] PR summary and labels follow [the
guidelines](https://github.com/SonarSource/rspec/#to-modify-an-existing-rule)