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

Add suggestion for 'no-collection-size-mischeck'

Merged
merged 2 commits into from Mar 24, 2022

Conversation

yassin-kammoun-sonarsource
Copy link
Contributor

@yassin-kammoun-sonarsource yassin-kammoun-sonarsource commented Mar 23, 2022

@@ -54,6 +54,16 @@ ruleTester.run('Collection sizes and array length comparisons should make sense'
endLine: 1,
column: 5,
endColumn: 24,
suggestions: [
{
messageId: 'suggestFixedSizeCheck',
Copy link
Contributor

@vilchik-elena vilchik-elena Mar 24, 2022

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?

Copy link
Contributor Author

@yassin-kammoun-sonarsource yassin-kammoun-sonarsource Mar 24, 2022

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}}"',
Copy link
Contributor

@vilchik-elena vilchik-elena Mar 24, 2022

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

@vilchik-elena vilchik-elena added this to the 0.13.0 milestone Mar 24, 2022
@sonarcloud
Copy link

sonarcloud bot commented Mar 24, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@vilchik-elena vilchik-elena merged commit b980329 into master Mar 24, 2022
5 checks passed
@vilchik-elena vilchik-elena deleted the sonarjs/issue-3021 branch Mar 24, 2022
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.

None yet

2 participants