Skip to content
vale-cliPublic

About

A Vale-compatible implementation of the guidelines enforced by the alex linter: catch insensitive, inconsiderate writing.

Topics

Resources

Stars

25 stars

Watchers

2 watching

Forks

Latest commit

 

History

20 Commits

Folders and files

Repository files navigation

alex Build + Test Vale version license

alex: Catch insensitive, inconsiderate writing.

This repository contains a Vale-compatible implementation of the guidelines enforced by the alex (LICENSE) linter.

Getting Started

To get started, add the package to your configuration file (as shown below) and then run vale sync.

StylesPath = styles
MinAlertLevel = suggestion

Packages = alex

[*]
BasedOnStyles = alex

Rules

The rules are generated from the word lists that alex 11.0.1 ships (retext-equality 6.6.0 and cuss 2.2.0), and they match the way alex does:

  • Whole words, with case, hyphens, and apostrophes ignored: able-bodied and man's best friend match ablebodied and mans best friend.
  • A word set off as a literal is skipped: "crazy", (master), or Simple: ....
  • he and she are reported unless they sit together, as in he or she and his/her.
  • Every phrase is reported, so master plan raises both master and master plan. That is why a category has up to three rules: its words, its Phrases, and the Nested phrases that contain other phrases.
  • Tables and front matter are not read.
Rules Source
Ablist, Condescending, Gendered, LGBTQ, Press, Race, Slogans, Suicide One per retext-equality category.
GenderedPerson her, him, boy, girl: the phrases alex qualifies with "when referring to a person".
ProfanityLikely, ProfanityMaybe, ProfanityUnlikely cuss, by how sure it is.

alex reads profanitySureness from its own configuration. Here, turn the rules off instead:

# profanitySureness: 1
alex.ProfanityUnlikely = NO

# profanitySureness: 2
alex.ProfanityUnlikely = NO
alex.ProfanityMaybe = NO

Differences from alex

The style reports what alex reports, at the same line and column, except:

  • alex skips the last word of a paragraph that ends in a period when the next block starts with a lower-case letter. The style reports it.
  • alex reads the tables in an HTML file. The style skips tables in every format.
  • alex misplaces a word on the continuation lines of a list item or block quote, and counts a character outside the BMP as two columns. Vale reports where the word is.
  • In a chain of four or more paired words (he or she or he or she), the last one is reported.
  • A pair goes unrecognized when one of its words is written with a hyphen, as in fire-man and firewoman.
  • noBinary is not supported.

Development

$ cd script
$ npm install
$ npm run generate   # rewrite alex/*.yml and fixtures/phrases.md
$ cd ..
$ ./test.sh          # compare with the golden file, then with alex itself

To move to a newer alex, change its version in script/package.json and run the same steps. script/compare.mjs takes any Markdown, HTML, or text files and prints each finding the two tools disagree on.

About

A Vale-compatible implementation of the guidelines enforced by the alex linter: catch insensitive, inconsiderate writing.

Topics

Resources

Stars

25 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages