No Hyphen After -ly Words

Description

This rule checks for unnecessary hyphens that follow words ending in "-ly". Typically, adverbs ending in "-ly" don't need to be hyphenated when they modify an adjective or participle. This is a common writing mistake that can make text appear cluttered and inconsistent with standard style guides. The rule not only detects these unnecessary hyphens but also includes an automatic fix to replace the hyphen with a space.

Examples

Would flag:

  • "readily-available software" → "readily available software"
  • "quickly-moving traffic" → "quickly moving traffic"
  • "carefully-written documentation" → "carefully written documentation"

Would not flag:

  • "user-friendly interface" (doesn't end in -ly)
  • "family-owned business" (doesn't end in -ly)
  • "readily available options" (no hyphen present)

The automatic correction will remove the hyphen and replace it with a space in all cases where an -ly word is incorrectly hyphenated with the following word.

Rule Source

This rule comes from: https://github.com/mesosphere/dcos-docs-site

Rule Definition

extends: existence
message: "'%s' doesn't need a hyphen."
link: https://docs.microsoft.com/en-us/style-guide/punctuation/dashes-hyphens/hyphens
level: warning
ignorecase: false
nonword: true
action:
  name: edit
  params:
    - replace
    - '-'
    - ' '
tokens:
  - '\s[^\s-]+ly-'