Skip to content

Lint rule: one sentence per line #22

Description

@roxspring

Implement a lint rule that reports paragraph lines containing more than one sentence.

Background

Some documentation style guides require one sentence per line for clean diffs and readable source. This rule detects violations without modifying the file (see SentencePerLineFormatter for the auto-fix counterpart).

Scope

  • Visits Paragraph nodes in the AST
  • Detects sentence boundaries using the same heuristics as SentencePerLineFormatter (. , ? , ! followed by uppercase or end of content)
  • Reports a violation if a single source line contains more than one sentence
  • Reports file path and line number

Notes

  • Known limitation: abbreviations (e.g. "e.g. ", "Dr. ") may produce false positives — document this
  • Inline code spans and bold/italic content are treated as atomic (no boundary detection inside them)

Acceptance criteria

  • Line with one sentence: no violation
  • Line with two sentences: violation reported
  • Line ending inside an inline code span: not a false positive
  • Fenced code blocks: skipped

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions