MCPcopy
hub / github.com/prettier/prettier / getOptionsWithOpposites

Function getOptionsWithOpposites

src/cli/usage.js:97–111  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

95}
96
97function getOptionsWithOpposites(options) {
98 // Add --no-foo after --foo.
99 const optionsWithOpposites = options.map((option) => [
100 option.description ? option : null,
101 option.oppositeDescription
102 ? {
103 ...option,
104 name: `no-${option.name}`,
105 type: "boolean",
106 description: option.oppositeDescription,
107 }
108 : null,
109 ]);
110 return optionsWithOpposites.flat().filter(Boolean);
111}
112
113function createUsage(context) {
114 const sortedOptions = context.detailedOptions.sort((optionA, optionB) =>

Callers 2

createUsageFunction · 0.85
createDetailedUsageFunction · 0.85

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…