Automattic / Automattic/harper

WordChoice rule (`MissingTo`) fires without part-of-speech context

Open
#3,951 1 comment 2 reactions 0 assignees View on GitHub
bug false-positive grammar harper-core linting
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 15h
Merged PRs (30d)
106

Description

**What got flagged?**

"This Article’s aims are both theoretical and historical"

**Why is this incorrect?**

`aims` (noun, subject of *are*) is read as the verb, and the rule wants an infinitive (`aims to`).

Sentence is grammatical as written and suggestion would make it
wrong. The rule appears to ignore possessive and to pattern-match the token without resolving its part
of speech from the frame it sits in (`X’s aims are` not `X aims to` ).

**Example of correct usage:**

no finding.

Measured on harper.js 2.4.0: with`LongSentences` disabled.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the MissingTo finding on “This Article’s aims are both theoretical and historical,” using the harper.js 2.4.0 behavior described in the issue. Inspect the MissingTo rule entry point and its existing tests; done means this grammatical sentence produces no finding while valid “aims to” usage remains detected.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.