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
Add suggestion for 'no-collection-size-mischeck' #340
Conversation
@@ -54,6 +54,16 @@ ruleTester.run('Collection sizes and array length comparisons should make sense' | |||
endLine: 1, | |||
column: 5, | |||
endColumn: 24, | |||
suggestions: [ | |||
{ | |||
messageId: 'suggestFixedSizeCheck', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we assert concrete message here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, TypeScript ESLint allows only messageId.
@@ -31,9 +31,11 @@ const rule: TSESLint.RuleModule<string, string[]> = { | |||
messages: { | |||
fixCollectionSizeCheck: | |||
'Fix this expression; {{propertyName}} of "{{objectName}}" is always greater or equal to zero.', | |||
suggestFixedSizeCheck: 'Replace {{operation}} check with "{{operator}}"', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use "{{operator}}" for {{operation}} check
Kudos, SonarCloud Quality Gate passed! |
SonarSource/SonarJS#3021