Adds rule to discourage em dashes

Adds a Vale rule to warn against the use of em dashes in formal writing.

It suggests using commas or rephrasing as alternative solutions.
The rule is configurable to also detect spaced em dashes or incorrect hyphen usage.
This commit is contained in:
Vijay Janapa Reddi
2025-06-05 09:28:21 -04:00
parent 9dea2eccaf
commit a7c546ddc3

View File

@@ -0,0 +1,16 @@
extends: substitution
message: "Avoid em dashes (—) in formal writing; use commas or rephrase."
level: warning
ignorecase: false
scope: raw
nonword: true
swap:
# Match an em dash between words/clauses, suggest using commas
'\b[^—\n]+—[^—\n]+\b': ', ... ,'
# Optional: also match spaced em dash style (— on both sides)
# '\s+—\s+': ', '
# Optional: flag improper use of hyphen instead of dash (uncomment to activate)
# '\s+-\s+': '— (em dash) or comma'