Skip to content

Commit

Permalink
Add options to specify extra plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Jun 5, 2020
1 parent f6c44f9 commit e43475c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ Boolean. Set to `false` to skip generating (or replacing) a Table of Contents. A

String or array. See [Contributors Table](#contributors-table) for details. Aliased as `community`. Set to `false` to disable this feature entirely.

### `plugins`

An array of extra plugins, to be applied in both lint and `--fix` mode.

### `fixers`

An array of extra plugins, to be applied in `--fix` mode.

## Opt-in Features

### Table of Contents
Expand Down
7 changes: 6 additions & 1 deletion options.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ module.exports = function (argv, pkg, packageOpts, files, cwd, repository) {
? packageOpts.contributors
: packageOpts.community

const plugins = { plugins: packageOpts.plugins || [] }
const fixers = { plugins: packageOpts.fixers || [] }

return {
processor,
extensions,
Expand Down Expand Up @@ -51,7 +54,9 @@ module.exports = function (argv, pkg, packageOpts, files, cwd, repository) {
summary: 'Click to expand'
}] : null,

require('./lint')(fix, cwd, packageOpts, repository)
fix ? fixers : null,
require('./lint')(fix, cwd, packageOpts, repository),
plugins
].filter(Boolean),
settings: {
// One style for code blocks, whether they have a language or not.
Expand Down

0 comments on commit e43475c

Please sign in to comment.