Skip to content

Commit

Permalink
Document passings args to formatters (#4688)
Browse files Browse the repository at this point in the history
* Document passings args to formatters
  • Loading branch information
jeddy3 committed Apr 9, 2020
1 parent c14a40f commit 011548b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/developer-guide/formatters.md
Expand Up @@ -79,6 +79,20 @@ And the second argument (`returnValue`) is an object with one or more of the fol
}
```

## Passing arguments

You can use environmental variables in your formatter. For example, pass `SKIP_WARNINGS`:

```console
SKIP_WARNINGS=true stylelint "*.css" --custom-formatter ./my-formatter.js
```

Alternatively, you can create a separate formatting program and pipe the output from the built-in JSON formatter into it:

```console
stylelint -f json "*.css" | my-program-that-reads-JSON --option
```

## `stylelint.formatters`

stylelint's internal formatters are exposed publicly in `stylelint.formatters`.

0 comments on commit 011548b

Please sign in to comment.