Skip to content

Export minimist options - #1352

Closed
josephfrazier wants to merge 1 commit into
prettier:masterfrom
josephfrazier:export-minimist-opts
Closed

josephfrazier wants to merge 1 commit into
prettier:masterfrom
josephfrazier:export-minimist-opts

Conversation

@josephfrazier

Copy link
Copy Markdown
Collaborator

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.

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.
@vjeux

vjeux commented Apr 20, 2017

Copy link
Copy Markdown
Contributor

I'm curious, what's the motivation behind this change?

@josephfrazier

Copy link
Copy Markdown
Collaborator Author

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.

@vjeux

vjeux commented May 5, 2017

Copy link
Copy Markdown
Contributor

@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!

@vjeux vjeux closed this May 5, 2017
@josephfrazier

Copy link
Copy Markdown
Collaborator Author

No worries, I know you're busy. That makes sense, about reaching into prettier's internals. Thanks for the consideration!

josephfrazier added a commit to josephfrazier/prettier that referenced this pull request Jul 9, 2017
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.
@lock lock Bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jan 20, 2019
@lock lock Bot locked as resolved and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants