Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

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

Merged
merged 2 commits into from
Mar 24, 2022

Conversation

yassin-kammoun-sonarsource
Copy link
Contributor

@@ -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

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

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

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
@sonarqubecloud
Copy link

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
@vilchik-elena vilchik-elena deleted the sonarjs/issue-3021 branch March 24, 2022 11:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants