remarkjs / ideas

Share ideas for new utilities and tools built with @remarkjs
https://remark.js.org
5 stars 1 forks source link

Allow passing extensions in the .remarkrc #10

Closed remcohaszing closed 5 years ago

remcohaszing commented 5 years ago

Subject of the feature

It should be possible to specify the extension on which to run the CLI in the .remarkrc file.

Problem

I would like to run remark-lint on my .mdx files.

Expected behaviour

Extensions can be configured in .remarkrc. E.g.:

exports.extensions = ['md', 'mdx'];

// or

exports.ext = ['md', 'mdx'];

Alternatives

ext can be passed as a command line parameter.

remark --ext md,mdx .
wooorm commented 5 years ago

I think --ext, --extension should remain the only way to define extensions (you can also use globs btw).

We can’t store configuration on how to search in config files, because config files are detected after files are found. First files searched, then for each file the closest config file is found.

Adding extensions in config files would come with technical difficulties and a bunch of added complexity, I think the current alternative (remark --ext md,mdx .) is fine.