The Question Mark - blog by Mark Volkmann

Vale

Overview

Vale CLI is an open source, command-line tool that reports on writing style issues found in text files. It does not provide suggestions for fixing the issues.

Installing

To install Vale in macOS:

  1. Enter brew install vale.

  2. Create a configuration file named .vale.ini in your home directory containing settings like the following:

    StylesPath = vale-styles
    MinAlertLevel = suggestion
    Packages = Microsoft, proselint, write-good
    
    # Only process AsciiDoc, Markdown, and plain text files.
    [*.{adoc,md,txt}]
    BasedOnStyles = Vale, Microsoft, proselint, write-good
    Microsoft.Contractions = off
    Microsoft.HeadingAcronyms = off
    Microsoft.HeadingPunctuation = off
    Microsoft.Headings = off
    Microsoft.Quotes = off
    
    [*]
    BasedOnStyles = Empty
    
  3. Enter the command vale sync to download each of the packages listed in the config file.

  4. Create the empty directory ~/vale-styles/Empty.

  5. Set the environment variable VALE_CONFIG_PATH to point to the .vale.ini file. For example, add the following in .zshenv:

    export VALE_CONFIG_PATH=$HOME/.vale.ini
    

Running

  1. Open a terminal window.
  2. cd to the directory of a file to check.
  3. Enter the command vale {file-name}.

VS Code

Install the Vale VSCode extension from Chris Chinchilla. This causes VS Code to flag writing style issues.

In settings, set “Vale > Vale CLI: Config” to “/Users/{your-username}/.vale.ini”.