Skip to content

Document boolean duplicate-constant threshold - #50261

Merged
pelikhan merged 2 commits into
mainfrom
copilot/eslint-miner-eslint-factory-guard
Aug 4, 2026
Merged

Document boolean duplicate-constant threshold#50261
pelikhan merged 2 commits into
mainfrom
copilot/eslint-miner-eslint-factory-guard

Conversation

Copilot AI commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

no-duplicate-constant-values applies a three-declaration coincidence guard to booleans, matching numeric constants. This avoids reporting common module-level flag values as duplicates.

  • Rule behavior

    • Boolean and numeric values report only when at least three module-level constants share the value.
    const FIRST_ENABLED = true;
    const SECOND_ENABLED = true;
    const THIRD_ENABLED = true; // reported
  • Documentation

    • Clarifies the numeric and boolean threshold in the ESLint factory README.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add guard against boolean false positives in no-duplicate-constant-values Document boolean duplicate-constant threshold Aug 4, 2026
Copilot AI requested a review from pelikhan August 4, 2026 13:29
@pelikhan
pelikhan marked this pull request as ready for review August 4, 2026 13:29
Copilot AI balanced review requested due to automatic review settings August 4, 2026 13:29
@pelikhan
pelikhan merged commit 46ca2c3 into main Aug 4, 2026
1 check passed
@pelikhan
pelikhan deleted the copilot/eslint-miner-eslint-factory-guard branch August 4, 2026 13:30
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Hey @github/gh-aw-maintainers 👋 — this work on guarding no-duplicate-constant-values against boolean false positives looks solid.

Why this matters: Booleans have only 2 possible values, making coincidental duplication far more likely than the numeric case. The fix mirrors the existing MIN_NUMERIC_DUPLICATE_GROUP_SIZE = 3 guard with an equivalent boolean threshold.

What's been done:

  • ✅ Rule logic updated in eslint-factory/src/rules/no-duplicate-constant-values.ts
  • ✅ Comprehensive test coverage added (6/6 passing)
  • ✅ Documentation updated in eslint-factory/README.md
  • ✅ Full validation suite run (linting, build, vitest)

Ready to go: This PR is authored by the Copilot coding agent and follows the intended agentic workflow process. The underlying work is complete and well-tested. Once the changeset is finalized (currently in WIP state), this should be ready for merge.

Generated by ✅ Contribution Check · auto · 58.8 AIC · ⌖ 5.02 AIC · ⊞ 8.8K ·

Copilot AI left a comment

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.

Pull request overview

Documents the duplicate-reporting threshold for numeric and boolean constants.

Changes:

  • Clarifies that three matching module-level constants are required before reporting numeric or boolean duplicates.
Show a summary per file
File Description
eslint-factory/README.md Documents numeric and boolean duplicate thresholds.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.84.4

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.

[eslint-miner] eslint-factory: guard no-duplicate-constant-values against boolean false positives

3 participants