Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix S6535 (unnecessary-character-escapes): Disambiguate conflicting message ids #4108

Merged
merged 2 commits into from Aug 25, 2023

Conversation

yassin-kammoun-sonarsource
Copy link
Contributor

Fixes #3987

S6535 implementation consists of merging ESLint rules no-useless-escape and no-nonoctal-decimal-escape. However, both share a common message id escapeBackslash with a different description for their respective suggestions. Because this wasn't noticed at the time of merging the rules, the message id escapeBackslash from no-nonoctal-decimal-escape used to overwrite the one from no-useless-escape. This is why not only the suggestion messages were sometimes confusing but also why the data interpolation of some suggestions didn't occur.

const noUselessEscapeRule = eslintRules['no-useless-escape'];
const noNonoctalDecimalEscapeRule = eslintRules['no-nonoctal-decimal-escape'];

/**
* We replace the message id 'escapeBackslash' of 'no-nonoctal-decimal-escape' with 'otherEscapeBackslash'.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename it nonOctalEscapeBacklash?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@ilia-kebets-sonarsource ilia-kebets-sonarsource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but one suggestion.

@sonarqube-next
Copy link

@yassin-kammoun-sonarsource yassin-kammoun-sonarsource merged commit 58adb63 into master Aug 25, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix S6535 (unnecessary-character-escapes): Disambiguate conflicting message ids
2 participants