diff --git a/README.md b/README.md index 3adf71f..7769aca 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/options.js b/options.js index 8377b2c..a601c1c 100644 --- a/options.js +++ b/options.js @@ -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, @@ -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.