Latin Abbreviation Substitution

This rule enforces the replacement of common Latin abbreviations (e.g., and i.e.) with their plain English equivalents. The motivation behind this rule is to improve readability and accessibility - not all readers are familiar with Latin abbreviations, and using clear English alternatives makes content more inclusive and easier to understand.

The rule follows Google's developer documentation style guide recommendations for avoiding Latin abbreviations in favor of plain language.

Examples:

✗ Incorrect:

  • "You need to include required files, e.g., config.json"
  • "The build failed, i.e., it didn't complete"

✓ Correct:

  • "You need to include required files, for example, config.json"
  • "The build failed, that is, it didn't complete"

The rule will flag:

  • e.g.
  • eg
  • i.e.
  • ie

And suggest replacing them with:

  • "for example" (instead of e.g./eg)
  • "that is" (instead of i.e./ie)

Rule Source

This rule comes from: https://github.com/jump-dev/JuMP.jl

Rule Definition

extends: substitution
message: "Use '%s' instead of '%s'."
link: 'https://developers.google.com/style/abbreviations'
ignorecase: true
level: error
nonword: true
action:
  name: replace
swap:
  '\b(?:eg|e\.g\.)[\s,]': for example
  '\b(?:ie|i\.e\.)[\s,]': that is