Skip to content

Commit 649d19c

Browse files
Manually reformatted bin.ts file, for more consistent formatting
1 parent 7ffc2d7 commit 649d19c

File tree

2 files changed

+90
-56
lines changed

2 files changed

+90
-56
lines changed

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bin.ts

src/bin.ts

+89-56
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,28 @@ const makeBin = (): Bin => {
1919
.usage(`${color.cyan("prettier")} ${color.yellow('"src/**/*.js"')} ${color.green("--check")}`)
2020
.usage(`${color.cyan("prettier")} ${color.yellow('"src/**/*.js"')} ${color.green("-l")} ${color.green("--no-cache")}`)
2121
.usage(`${color.cyan("prettier")} ${color.yellow('"src/**/*.js"')} ${color.green("--write")} ${color.green("--no-parallel")}`)
22-
.usage(
23-
`${color.cyan("prettier")} ${color.yellow("./path/to/target/file.js")} ${color.green("--cache-location")} ${color.blue("./path/to/cache/file.json")}`,
24-
)
22+
.usage(`${color.cyan("prettier")} ${color.yellow("./path/to/target/file.js")} ${color.green("--cache-location")} ${color.blue("./path/to/cache/file.json")}`)
2523
/* OUTPUT OPTIONS */
26-
.option("--check, -c", "Check if the given files are formatted, print a human-friendly summary (see also --list-different)", { section: "Output" })
27-
.option("--list-different, -l", "Print the names of files that are different from Prettier's formatting (see also --check)", { section: "Output" })
28-
.option("--write, -w", "Edit files in-place (Beware!)", { section: "Output" })
24+
.option("--check, -c", "Check if the given files are formatted, print a human-friendly summary (see also --list-different)", {
25+
section: "Output",
26+
})
27+
.option("--list-different, -l", "Print the names of files that are different from Prettier's formatting (see also --check)", {
28+
section: "Output",
29+
})
30+
.option("--write, -w", "Edit files in-place (Beware!)", {
31+
section: "Output",
32+
})
2933
/* FORMAT OPTIONS */
3034
.option("--arrow-parens <always|avoid>", 'Include parentheses around a sole arrow function parameter\nDefaults to "always"', {
3135
section: "Format",
3236
enum: ["always", "avoid"],
3337
})
34-
.option("--bracket-same-line", 'Put ">" of opening tags on the last line instead of on a new line\nDefaults to "false"', { section: "Format" })
35-
.option("--no-bracket-spacing", 'Do not print spaces between brackets\nDefaults to "true"', { section: "Format" })
38+
.option("--bracket-same-line", 'Put ">" of opening tags on the last line instead of on a new line\nDefaults to "false"', {
39+
section: "Format",
40+
})
41+
.option("--no-bracket-spacing", 'Do not print spaces between brackets\nDefaults to "true"', {
42+
section: "Format",
43+
})
3644
.option("--embedded-language-formatting <auto|off>", 'Control how Prettier formats quoted code embedded in the file\nDefaults to "auto"', {
3745
section: "Format",
3846
enum: ["auto", "off"],
@@ -48,12 +56,13 @@ const makeBin = (): Bin => {
4856
section: "Format",
4957
enum: ["css", "strict", "ignore"],
5058
})
51-
.option("--jsx-single-quote", 'Use single quotes in JSX\nDefaults to "false"', { section: "Format" })
52-
.option(
53-
"--parser <flow|babel|babel-flow|babel-ts|typescript|acorn|espree|meriyah|css|less|scss|json|json5|json-stringify|graphql|markdown|mdx|vue|yaml|glimmer|html|angular|lwc>",
54-
"Which parser to use",
55-
{ section: "Format", enum: ["flow", "babel", "babel-flow", "babel-ts", "typescript", "acorn", "espree", "meriyah", "css", "less", "scss", "json", "json5", "json-stringify", "graphql", "markdown", "mdx", "vue", "yaml", "glimmer", "html", "angular", "lwc"] }, // prettier-ignore
56-
)
59+
.option("--jsx-single-quote", 'Use single quotes in JSX\nDefaults to "false"', {
60+
section: "Format",
61+
})
62+
.option("--parser <flow|babel|babel-flow|babel-ts|typescript|acorn|espree|meriyah|css|less|scss|json|json5|json-stringify|graphql|markdown|mdx|vue|yaml|glimmer|html|angular|lwc>", "Which parser to use", {
63+
section: "Format",
64+
enum: ["flow", "babel", "babel-flow", "babel-ts", "typescript", "acorn", "espree", "meriyah", "css", "less", "scss", "json", "json5", "json-stringify", "graphql", "markdown", "mdx", "vue", "yaml", "glimmer", "html", "angular", "lwc"],
65+
})
5766
.option("--print-width <int>", 'The line length where Prettier will try wrap\nDefaults to "80"', {
5867
section: "Format",
5968
})
@@ -65,15 +74,26 @@ const makeBin = (): Bin => {
6574
section: "Format",
6675
enum: ["as-needed", "consistent", "preserve"],
6776
})
68-
.option("--no-semi", 'Do not print semicolons, except at the beginning of lines which may need them\nDefaults to "true"', { section: "Format" })
69-
.option("--single-attribute-per-line", 'Enforce single attribute per line in HTML, Vue and JSX\nDefaults to "false"', { section: "Format" })
70-
.option("--single-quote", 'Use single quotes instead of double quotes\nDefaults to "false"', { section: "Format" })
71-
.option("--tab-width <int>", 'Number of spaces per indentation level\nDefaults to "2"', { section: "Format" })
77+
.option("--no-semi", 'Do not print semicolons, except at the beginning of lines which may need them\nDefaults to "true"', {
78+
section: "Format",
79+
})
80+
.option("--single-attribute-per-line", 'Enforce single attribute per line in HTML, Vue and JSX\nDefaults to "false"', {
81+
section: "Format",
82+
})
83+
.option("--single-quote", 'Use single quotes instead of double quotes\nDefaults to "false"', {
84+
section: "Format",
85+
})
86+
.option("--tab-width <int>", 'Number of spaces per indentation level\nDefaults to "2"', {
87+
section: "Format",
88+
type: "integer",
89+
})
7290
.option("--trailing-comma <all|es5|none>", 'Print trailing commas wherever possible when multi-line\nDefaults to "all"', {
7391
section: "Format",
7492
enum: ["all", "es5", "none"],
7593
})
76-
.option("--use-tabs", 'Indent with tabs instead of spaces\nDefaults to "false"', { section: "Format" })
94+
.option("--use-tabs", 'Indent with tabs instead of spaces\nDefaults to "false"', {
95+
section: "Format",
96+
})
7797
.option("--vue-indent-script-and-style", 'Indent script and style tags in Vue files\nDefaults to "false"', {
7898
section: "Format",
7999
})
@@ -82,61 +102,74 @@ const makeBin = (): Bin => {
82102
section: "Config",
83103
default: true,
84104
})
85-
.option("--config-path <path>", "Path to a Prettier configuration file (.prettierrc, package.json, prettier.config.js)", { section: "Config" })
86-
.option(
87-
"--config-precedence <cli-override|file-override>",
88-
'Define in which order config files and CLI options should be evaluated.\nDefaults to "cli-override"',
89-
{
90-
section: "Config",
91-
enum: ["cli-override", "file-override"],
92-
},
93-
)
105+
.option("--config-path <path>", "Path to a Prettier configuration file (.prettierrc, package.json, prettier.config.js)", {
106+
section: "Config",
107+
})
108+
.option("--config-precedence <cli-override|file-override>", 'Define in which order config files and CLI options should be evaluated.\nDefaults to "cli-override"', {
109+
section: "Config",
110+
enum: ["cli-override", "file-override"],
111+
})
94112
.option("--no-editorconfig", "Don't take .editorconfig into account when parsing configuration", {
95113
section: "Config",
96114
default: true,
97115
})
98-
.option(
99-
"--ignore-path <path...>",
100-
"Path to a file with patterns describing files to ignore\nMultiple values are accepted\nDefaults to [.gitignore, .prettierignore]",
101-
{ section: "Config" },
102-
)
103-
.option("--plugin <package...>", "Add a plugin\nMultiple plugins are accepted\nDefaults to []", { section: "Config" })
104-
.option("--with-node-modules", 'Process files inside the "node_modules" directory', { section: "Config" })
116+
.option("--ignore-path <path...>", "Path to a file with patterns describing files to ignore\nMultiple values are accepted\nDefaults to [.gitignore, .prettierignore]", {
117+
section: "Config",
118+
})
119+
.option("--plugin <package...>", "Add a plugin\nMultiple plugins are accepted\nDefaults to []", {
120+
section: "Config",
121+
})
122+
.option("--with-node-modules", 'Process files inside the "node_modules" directory', {
123+
section: "Config",
124+
})
105125
/* EDITOR OPTIONS */
106126
.option("--cursor-offset <int>", 'Print (to stderr) where a cursor at the given position would move to after formatting\nDefaults to "-1"', {
107127
section: "Editor",
108128
})
109-
.option(
110-
"--range-end <int>",
111-
'Format code ending at a given character offset (exclusive)\nThe range will extend forwards to the end of the selected statement\nDefaults to "Infinity"',
112-
{ section: "Editor" },
113-
)
114-
.option(
115-
"--range-start <int>",
116-
'Format code starting at a given character offset\nThe range will extend backwards to the start of the first line containing the selected statement\nDefaults to "0"',
117-
{ section: "Editor" },
118-
)
129+
.option("--range-end <int>", 'Format code ending at a given character offset (exclusive)\nThe range will extend forwards to the end of the selected statement\nDefaults to "Infinity"', {
130+
section: "Editor",
131+
})
132+
.option("--range-start <int>", 'Format code starting at a given character offset\nThe range will extend backwards to the start of the first line containing the selected statement\nDefaults to "0"', {
133+
section: "Editor",
134+
})
119135
/* OTHER OPTIONS */
120136
.option("--no-cache", "Do not use the built-in caching mechanism", {
137+
section: "Other",
121138
default: true,
122139
})
123-
.option("--cache-location <path>", "Path to the cache file")
124-
.option("--no-color", "Do not colorize output messages")
125-
.option("--no-error-on-unmatched-pattern", "Prevent errors when pattern is unmatched", { default: true })
126-
.option("--ignore-unknown, -u", "Ignore unknown files")
127-
.option("--insert-pragma", 'Insert @format pragma into file\'s first docblock comment\nDefaults to "false"')
140+
.option("--cache-location <path>", "Path to the cache file", {
141+
section: "Other",
142+
})
143+
.option("--no-color", "Do not colorize output messages", {
144+
section: "Other",
145+
})
146+
.option("--no-error-on-unmatched-pattern", "Prevent errors when pattern is unmatched", {
147+
section: "Other",
148+
default: true
149+
})
150+
.option("--ignore-unknown, -u", "Ignore unknown files", {
151+
section: "Other",
152+
})
153+
.option("--insert-pragma", 'Insert @format pragma into file\'s first docblock comment\nDefaults to "false"', {
154+
section: "Other",
155+
})
128156
.option("--log-level <silent|error|warn|log|debug>", 'What level of logs to report\nDefaults to "log"', {
157+
section: "Other",
129158
enum: ["silent", "error", "warn", "log", "debug"],
130159
})
131160
.option("--no-parallel", 'Process files in parallel\nDefaults to "true"', {
161+
section: "Other",
132162
default: true,
133163
})
134-
.option("--parallel-workers <int>", 'Number of parallel workers to use\nDefaults to "0"')
135-
.option(
136-
"--require-pragma",
137-
'Require either "@prettier" or "@format" to be present in the file\'s first docblock comment in order for it to be formatted\nDefaults to "false"',
138-
)
139-
.option("--stdin-filepath <path>", "Path to the file to pretend that stdin comes from")
164+
.option("--parallel-workers <int>", 'Number of parallel workers to use\nDefaults to "0"', {
165+
section: "Other",
166+
})
167+
.option("--require-pragma", 'Require either "@prettier" or "@format" to be present in the file\'s first docblock comment in order for it to be formatted\nDefaults to "false"', {
168+
section: "Other",
169+
})
170+
.option("--stdin-filepath <path>", "Path to the file to pretend that stdin comes from", {
171+
section: "Other",
172+
})
140173
/* DEFAULT COMMAND */
141174
.argument("[file/dir/glob...]", "Files, directories or globs to format")
142175
.action(async (options, files) => {

0 commit comments

Comments
 (0)