Em or en dash
Em or en dash. An em or en dash (—) in a comment or string. It is the most-cited tell of machine-written text.
This is how the comment reads inline, under the flagged line.
Why it matters
Readers now take the em dash as a sign nobody edited the text. In logs and UI strings it also breaks grep and plain-ASCII terminals.
What to do
Use a comma, colon, parentheses or a plain hyphen, or split the sentence.
Examples
throw new Error("Upload failed — try again");throw new Error("Upload failed. Try again.");What it catches
It reads a pattern on each line, aware of strings and comments. Languages: Any file. Scope: All files. These cases are the rule's own tests: the first set must be flagged and the second must not.
Flagged
const s = "fast — and cheap";
// one – two
Left alone
const s = "fast - and cheap";
const a = b - c;
Research
Em and en dashes (U+2014, U+2013) in comments and strings. Readers take them as a sign of unedited generated text, and they break plain-ASCII grep and terminals.
- Em dashes and spotting AI writing
- ChatGPT and the em dash
- skill: humanizer
Turn it off or change it
In a config file for the CLI, or in the API's rules field:
{
"rules": {
"disable": [
"em-dash"
],
"severity": {
"em-dash": "medium"
}
}
}