refactor(options): use supportOptions to generate CLI options#3622
refactor(options): use supportOptions to generate CLI options#3622ikatyang merged 21 commits intoprettier:masterfrom
Conversation
* add `showDeprecated` option * add `showUnreleased` option
azz
left a comment
There was a problem hiding this comment.
Looking good. How much more involved would it be to include external plugin options too?
| astFormat: "estree", | ||
| printer: {}, | ||
| __inJsTemplate: false | ||
| printer: {} |
There was a problem hiding this comment.
This was just to satisfy jest-validate. Might not be required now.
There was a problem hiding this comment.
It's also used to bypass the option validation, see L62.
|
We need to generate |
|
|
||
| let option = constant.detailedOptionMap[key]; | ||
| if (type === "api" && option === undefined) { | ||
| option = constant.apiDetailedOptionMap[key]; |
There was a problem hiding this comment.
This was the only consumer for apiDetailedOptionMap, so probably just remove it entirely. This only dates back to #3584. It's not part of the public API and never made it into a release anyway.
There was a problem hiding this comment.
Oops, misread. Never mind. Sorry.
|
What's the status of this PR? |
|
It should be good to go if there's no further comments. |
|
Looks good to me but I'm super tired and have had some 🍷 so maybe wait for someone else to review? |
|
Anyone wants to review this one? |
| @@ -1,3 +1,3 @@ | |||
| { | |||
| "trailing-comma": "wow" | |||
| "trailingComma": "wow" | |||
|
Let's just merge this? |
…er#3622) * refactor(cli-constant): use supportOptions * refactor(options): use supportOptions * refactor(cli-util): use supportOptions * fix: do not infer parser in multiparser * chore: remove unnecessary package * chore: trigger another travis build * test: add kebab-case test to ensure no regression * test: update snapshots
deprecated.js,jest-validateand warnings inoptions.jswithmain/options-*.jsFixes #3756