This rule enforces the consistent use of em dashes (—) instead of en dashes (–) in text. It's designed to promote proper typographical practice according to the Google Developer Style Guide. The distinction between en dashes and em dashes is important because they serve different purposes in writing, and using them correctly enhances readability and professionalism.
The rule specifically:
- Detects any instances of en dashes (–)
- Suggests replacing them with em dashes (—)
- Includes an automatic fix action to replace the incorrect character
Examples
Will flag:
- "The project–which started last year–is almost complete" ❌
- "2020–2021" ❌
- "Pages 10–15" ❌
Should be:
- "The project—which started last year—is almost complete" ✅
- "2020—2021" ✅
- "Pages 10—15" ✅
Note: While this rule enforces em dash usage in all cases, in some style guides en dashes might be preferred for specific uses like ranges. Users should adjust this rule based on their specific style guide requirements.