Automattic / Automattic/harper

[False Positive] `# <Word> To-Do` is flagged as not title case & code action gives wrong suggestion

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

Description

**What got flagged?**
Line:
```markdown
## Daily To-Do

```
**Diagnostic on that line:**
Try to use title case in headings.

The code action also gives wrong suggestion.

Image

Just adding `# Todo` as heading doesn't the trigger the warning. Only when an additional word is added to the heading, it flags the heading not been title case.

**Additional Information**

nvim-lspconfig:
```lua
harper_ls = {
enabled = true,
filetypes = { 'markdown'},
settings = {
['harper-ls'] = {
userDictPath = '~/.config/nvim/spell/en.utf-8.add',
-- linters = {
-- -- ToDoHyphen = false,
-- -- SentenceCapitalization = true,
-- -- SpellCheck = true,
-- },
isolateEnglish = true,
markdown = {
IgnoreLinkTitle = true,
},
},
},
},

```

Contributor guide

Open the contributing guide

Research direction

Reproduce the diagnostic and code action on the Markdown heading `## Daily To-Do`, using the nvim-lspconfig setup shown in the issue. Start by tracing the title-case check and its suggestion for headings with `To-Do`; done means this heading is not falsely flagged and the code action no longer suggests the wrong replacement.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown, neovim, rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.