Skip to content

feat(weir): add SameExact rule to catch redundant "same exact"#3539

Open
jlaportebot wants to merge 4 commits into
Automattic:masterfrom
jlaportebot:feat/same-exact-lint
Open

feat(weir): add SameExact rule to catch redundant "same exact"#3539
jlaportebot wants to merge 4 commits into
Automattic:masterfrom
jlaportebot:feat/same-exact-lint

Conversation

@jlaportebot
Copy link
Copy Markdown
Contributor

@jlaportebot jlaportebot commented May 29, 2026

Summary

Adds a Weir rule that flags the redundant phrase same exact, since same already implies exactness. Suggests same alone.

Why this rule?

  • Redundancy: "same exact" is tautological — if two things are the same, they are necessarily exact.
  • Asymmetry: The inverse "exact same" is a valid emphasis pattern (e.g., "the exact same thing"), so this rule only targets "same exact" which lacks the emphasis justification.
  • Common mistake: "same exact" appears frequently in informal writing.

Changes

  • New SameExact.weir rule with test cases and allows guards
  • Added to default_config.json (alphabetical order)
  • Added to VS Code plugin package.json

Test coverage

  • 6 positive tests (catches "same exact" → "same")
  • 2 case-preservation tests (Title Case, UPPER CASE)
  • 5 negative tests (allows "exact same", "same" alone, etc.)

All 69 weir tests pass, including curated_default_config_lists_every_registered_rule.

AI Disclosure

  • I am a human and didn't use any AI.
  • I used LLM features of my editor, but not an agent.
  • I used an AI agent interactively.
  • I am an agent or I got an agent to do the work autonomously.

If Your PR Implements or Enhances a Linter

  • I made up the sentences in the unit tests.
  • The sentences in the unit tests were generated by an AI.
  • I'm using examples from the bug report / feature request.
  • I collected real-world sentences for the unit tests.

Checklist

  • I have performed a self-review of my own code
  • I have added tests to cover my changes
  • I have considered splitting this into smaller pull requests.

The phrase "same exact" is redundant since "same" already implies
exactness. This rule flags "same exact" and suggests "same" alone.
It correctly allows "exact same" which is a valid emphasis pattern.
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.

1 participant