Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@
[styles.defaultBadge, styles.condensedBadge, styles.alignSelfCenter, styles.ml2, StyleUtils, success, error, environment, badgeStyles, isCondensed, isStrong],
);

// TEST: deliberate violations for reviewer comment posting verification
// eslint-disable-next-line no-unused-vars

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❌ CONSISTENCY-5 (docs)

The eslint-disable-next-line no-unused-vars directive lacks an accompanying comment explaining why the rule needs to be disabled. The comment on the previous line (// TEST: deliberate violations...) describes the purpose of the test but does not justify why an unused variable is necessary in production code.

Either remove the unused variable badgeOpacity entirely, or add a clear justification comment explaining why the eslint rule must be suppressed. For example:

// eslint-disable-next-line no-unused-vars -- <reason why this unused variable must exist>
const badgeOpacity = isDeleted ? 0.5 : 1;

Reviewed at: 412c9f2 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

const badgeOpacity = isDeleted ? 0.5 : 1;

Check failure on line 97 in src/components/Badge.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'badgeOpacity' is assigned a value but never used

Check failure on line 97 in src/components/Badge.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'badgeOpacity' is assigned a value but never used

Check failure on line 97 in src/components/Badge.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

'badgeOpacity' is assigned a value but never used

Check failure on line 97 in src/components/Badge.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

'badgeOpacity' is assigned a value but never used

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❌ CONSISTENCY-2 (docs)

The number 0.5 is a magic number representing opacity for deleted badges. It is not self-explanatory -- why 0.5 rather than another value? It should be extracted to a named constant that documents its purpose.

Define descriptive constants at the module level:

const DELETED_BADGE_OPACITY = 0.5;
const DEFAULT_BADGE_OPACITY = 1;

Reviewed at: 412c9f2 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

const maxBadgeWidth = 200;

Check failure on line 98 in src/components/Badge.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'maxBadgeWidth' is assigned a value but never used

Check failure on line 98 in src/components/Badge.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'maxBadgeWidth' is assigned a value but never used

Check failure on line 98 in src/components/Badge.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

'maxBadgeWidth' is assigned a value but never used

Check failure on line 98 in src/components/Badge.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

'maxBadgeWidth' is assigned a value but never used

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❌ CONSISTENCY-2 (docs)

The number 200 is a magic number representing a pixel width. While it is assigned to a local variable, it should be defined as a descriptive module-level constant to improve clarity and reusability.

Define it as a named constant at the module level:

const MAX_BADGE_WIDTH = 200;

Reviewed at: 412c9f2 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.


if (!text && !icon) {
return null;
}
Expand Down
Loading