Skip to content

fix(core): flag 'less <adjective> that' as a typo for 'than' (#3736) - #3888

Draft
hammadmunir959 wants to merge 1 commit into
Automattic:masterfrom
hammadmunir959:fix/that-than-less-adjective
Draft

fix(core): flag 'less <adjective> that' as a typo for 'than' (#3736)#3888
hammadmunir959 wants to merge 1 commit into
Automattic:masterfrom
hammadmunir959:fix/that-than-less-adjective

Conversation

@hammadmunir959

Copy link
Copy Markdown

Issues

Fixes #3736

Description

Enhances the ThatThan linter in harper-core to catch false negatives when that is used as a typo for than in multi-word comparative phrases formed as less <adjective> that (e.g. "way less common that mp3" -> "way less common than mp3").
Guards against false positives by excluding clause-starting words (is, was, would, had, it, they, those, users, etc.) following that.

Demo

N/A (Core linting rule covered by unit tests).

How Has This Been Tested?

Added unit tests in harper-core/src/linting/that_than.rs (fix_way_less_common_that, fix_less_frequent_that). Verified zero regression against existing ThatThan tests and full test suite.

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.

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.

False negative missing "that" as a typo for "than"

1 participant