Repository navigation
Export minimist options - #1352
josephfrazier wants to merge 1 commit into
Conversation
This simply moves the `minimist` argument object from bin/prettier.js to
src/options.js and exports it, which allows programs built on top of
prettier to access it like `require('prettier/src/options').minimistOpts`.
The object is frozen to prevent external modification.
|
I'm curious, what's the motivation behind this change? |
|
Sure, I probably should have included that originally :) prettier_d is a wrapper around prettier that has a slightly different set of options (prettier_d options vs prettier options). If prettier made its options available, prettier_d could simply require them, copy them to a new object and modify that programmatically. This seems preferable to the current approach of copy/pasting the prettier source code, then manually updating it. |
|
@josephfrazier hey, so sorry I've been letting this pull request hang for so long and thanks for your awesome work on prettier_d. I however do not think that reaching into the internals of prettier is a good idea, so I think that it's better if you copy and paste those. Thanks for the PR! |
|
No worries, I know you're busy. That makes sense, about reaching into prettier's internals. Thanks for the consideration! |
Along the lines of prettier#1352, this allows programmatic access to the options prettier parses. It's intended for use with prettier_d, and currently makes no effort to prevent mutation.
This simply moves the
minimistargument object from bin/prettier.js tosrc/options.js and exports it, which allows programs built on top of
prettier to access it like
require('prettier/src/options').minimistOpts.The object is frozen to prevent external modification.