Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent double configuration for the same plugin #29

Closed
wooorm opened this issue Feb 12, 2017 · 1 comment
Closed

Prevent double configuration for the same plugin #29

wooorm opened this issue Feb 12, 2017 · 1 comment
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🧑 semver/major This is a change 🦋 type/enhancement This is great to have

Comments

@wooorm
Copy link
Member

wooorm commented Feb 12, 2017

unified().use([[plugin, {foo: true, bar: true}], [plugin, {foo: false, qux: true}]]);

...should not attach the same plugin twice. Rather, the config should be merged as if the following was given:

unified().use(plugin, {foo: false, bar: true, qux: true});

This would allow, for example, some configuration for remark-lint to live in a preset, whereas other configuration is passed by the user:

unified().use({plugins: [
  require('remark-lint-preset-recommended'),
  [require('remark-lint'), {finalNewline: false}]
]});

Unfortunately it’s not possible to merge configuration from different .use calls:

unified().use(plugin, {foo: true, bar: true}).use(plugin, {foo: false, qux: true});

😒

@wooorm
Copy link
Member Author

wooorm commented Feb 20, 2017

I made sure, in e73da90, that different .use calls also work!

@wooorm wooorm mentioned this issue Feb 20, 2017
11 tasks
@wooorm wooorm closed this as completed in e73da90 Feb 23, 2017
@wooorm wooorm added ⛵️ status/released 🗄 area/interface This affects the public interface 🦋 type/enhancement This is great to have 🧑 semver/major This is a change labels Aug 10, 2019
@wooorm wooorm added the 💪 phase/solved Post is done label May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🧑 semver/major This is a change 🦋 type/enhancement This is great to have
Development

No branches or pull requests

1 participant