Tweak option descriptions

master
Simon Lydell 2017-09-12 18:37:14 +02:00 committed by Ika
parent 602c2a2774
commit c99f7e2e38
2 changed files with 40 additions and 42 deletions

View File

@ -81,7 +81,7 @@ const detailedOptions = normalizeDetailedOptions({
type: "path",
category: CATEGORY_CONFIG,
description:
"Path to a prettier configuration file (.prettierrc, package.json, prettier.config.js).",
"Path to a Prettier configuration file (.prettierrc, package.json, prettier.config.js).",
oppositeDescription: "Do not look for a configuration file."
},
"config-precedence": {
@ -90,12 +90,12 @@ const detailedOptions = normalizeDetailedOptions({
default: "cli-override",
choices: ["cli-override", "file-override", "prefer-file"],
description: dedent(`
Defines how config file should be evaluated in combination of CLI options
Define in which order config files and CLI options should be evaluated
cli-override | default config => config file => CLI options
file-override | default config => CLI options => config file
prefer-file | default config => config file (if config file is found) or
default config => CLI options (if no config file is found)
Defaults to cli-override
Defaults to cli-override.
`)
},
"cursor-offset": {
@ -104,7 +104,7 @@ const detailedOptions = normalizeDetailedOptions({
forwardToApi: true,
description: dedent(`
Print (to stderr) where a cursor at the given position would move to after formatting.
This option cannot be used with --range-start and --range-end
This option cannot be used with --range-start and --range-end.
`)
},
"debug-check": {
@ -117,7 +117,7 @@ const detailedOptions = normalizeDetailedOptions({
type: "path",
category: CATEGORY_COMMAND,
description:
"Finds and prints the path to a configuration file for a given input file."
"Find and print the path to a configuration file for the given input file."
},
"flow-parser": {
// Deprecated in 0.0.10
@ -136,7 +136,7 @@ const detailedOptions = normalizeDetailedOptions({
category: CATEGORY_CONFIG,
default: ".prettierignore",
description: dedent(`
Path to a file containing patterns that describe files to ignore.
Path to a file with patterns describing files to ignore.
Defaults to ./.prettierignore.
`)
},
@ -151,23 +151,22 @@ const detailedOptions = normalizeDetailedOptions({
category: CATEGORY_COMMAND,
alias: "l",
description:
"Print filenames of files that are different from Prettier formatting."
"Print the names of files that are different from Prettier's formatting."
},
parser: {
type: "choice",
category: CATEGORY_FORMAT,
forwardToApi: true,
exception: value => typeof value === "string", // allow path to a parser module
exception: value => typeof value === "string", // Allow path to a parser module.
choices: ["flow", "babylon", "typescript", "postcss", "json", "graphql"],
description: "Specify which parser to use. Defaults to babylon.",
description: "Which parser to use. Defaults to babylon.",
getter: (value, argv) => (argv["flow-parser"] ? "flow" : value)
},
"print-width": {
type: "int",
category: CATEGORY_FORMAT,
forwardToApi: true,
description:
"Specify the length of line that the printer will wrap on. Defaults to 80."
description: "The line length where Prettier will try wrap. Defaults to 80."
},
"range-end": {
type: "int",
@ -212,14 +211,13 @@ const detailedOptions = normalizeDetailedOptions({
"stdin-filepath": {
type: "path",
forwardToApi: "filepath",
description: "Path to the file used to read from stdin."
description: "Path to the file to pretend that stdin comes from."
},
"tab-width": {
type: "int",
category: CATEGORY_FORMAT,
forwardToApi: true,
description:
"Specify the number of spaces per indentation-level. Defaults to 2."
description: "Number of spaces per indentation level. Defaults to 2."
},
"trailing-comma": {
type: "choice",
@ -238,7 +236,7 @@ const detailedOptions = normalizeDetailedOptions({
type: "boolean",
category: CATEGORY_FORMAT,
forwardToApi: true,
description: "Indent lines with tabs instead of spaces."
description: "Indent with tabs instead of spaces."
},
version: {
type: "boolean",
@ -254,7 +252,7 @@ const detailedOptions = normalizeDetailedOptions({
write: {
type: "boolean",
category: CATEGORY_COMMAND,
description: "Edit the file in-place. (Beware!)"
description: "Edit files in-place. (Beware!)"
}
});

View File

@ -6,19 +6,19 @@ exports[`show usage with --help 1`] = `
Command options:
--find-config-path <path>
Finds and prints the path to a configuration file for a given input file.
Find and print the path to a configuration file for the given input file.
--help or -h Show help.
--list-different or -l Print filenames of files that are different from Prettier formatting.
--list-different or -l Print the names of files that are different from Prettier's formatting.
--version or -v Print Prettier version.
--write Edit the file in-place. (Beware!)
--write Edit files in-place. (Beware!)
Format options:
--no-bracket-spacing Do not print spaces between brackets.
--jsx-bracket-same-line Put > on the last line instead of at a new line.
--parser <flow|babylon|typescript|postcss|json|graphql>
Specify which parser to use. Defaults to babylon.
--print-width <int> Specify the length of line that the printer will wrap on. Defaults to 80.
Which parser to use. Defaults to babylon.
--print-width <int> The line length where Prettier will try wrap. Defaults to 80.
--range-end <int> Format code ending at a given character offset (exclusive).
The range will extend forwards to the end of the selected statement.
This option cannot be used with --cursor-offset.
@ -29,23 +29,23 @@ Format options:
Defaults to 0.
--no-semi Do not print semicolons, except at the beginning of lines which may need them.
--single-quote Use single quotes instead of double quotes.
--tab-width <int> Specify the number of spaces per indentation-level. Defaults to 2.
--tab-width <int> Number of spaces per indentation level. Defaults to 2.
--trailing-comma <none|es5|all>
Print trailing commas wherever possible when multi-line. Defaults to none.
--use-tabs Indent lines with tabs instead of spaces.
--use-tabs Indent with tabs instead of spaces.
Config options:
--config <path> Path to a prettier configuration file (.prettierrc, package.json, prettier.config.js).
--config <path> Path to a Prettier configuration file (.prettierrc, package.json, prettier.config.js).
--no-config Do not look for a configuration file.
--config-precedence <cli-override|file-override|prefer-file>
Defines how config file should be evaluated in combination of CLI options
Define in which order config files and CLI options should be evaluated
cli-override | default config => config file => CLI options
file-override | default config => CLI options => config file
prefer-file | default config => config file (if config file is found) or
default config => CLI options (if no config file is found)
Defaults to cli-override
--ignore-path <path> Path to a file containing patterns that describe files to ignore.
Defaults to cli-override.
--ignore-path <path> Path to a file with patterns describing files to ignore.
Defaults to ./.prettierignore.
--with-node-modules Process files inside 'node_modules' directory.
@ -53,9 +53,9 @@ Other options:
--no-color Do not colorize error messages.
--cursor-offset <int> Print (to stderr) where a cursor at the given position would move to after formatting.
This option cannot be used with --range-start and --range-end
This option cannot be used with --range-start and --range-end.
--stdin Read input from stdin.
--stdin-filepath <path> Path to the file used to read from stdin.
--stdin-filepath <path> Path to the file to pretend that stdin comes from.
"
@ -67,19 +67,19 @@ exports[`throw error and show usage with something unexpected 1`] = `
Command options:
--find-config-path <path>
Finds and prints the path to a configuration file for a given input file.
Find and print the path to a configuration file for the given input file.
--help or -h Show help.
--list-different or -l Print filenames of files that are different from Prettier formatting.
--list-different or -l Print the names of files that are different from Prettier's formatting.
--version or -v Print Prettier version.
--write Edit the file in-place. (Beware!)
--write Edit files in-place. (Beware!)
Format options:
--no-bracket-spacing Do not print spaces between brackets.
--jsx-bracket-same-line Put > on the last line instead of at a new line.
--parser <flow|babylon|typescript|postcss|json|graphql>
Specify which parser to use. Defaults to babylon.
--print-width <int> Specify the length of line that the printer will wrap on. Defaults to 80.
Which parser to use. Defaults to babylon.
--print-width <int> The line length where Prettier will try wrap. Defaults to 80.
--range-end <int> Format code ending at a given character offset (exclusive).
The range will extend forwards to the end of the selected statement.
This option cannot be used with --cursor-offset.
@ -90,23 +90,23 @@ Format options:
Defaults to 0.
--no-semi Do not print semicolons, except at the beginning of lines which may need them.
--single-quote Use single quotes instead of double quotes.
--tab-width <int> Specify the number of spaces per indentation-level. Defaults to 2.
--tab-width <int> Number of spaces per indentation level. Defaults to 2.
--trailing-comma <none|es5|all>
Print trailing commas wherever possible when multi-line. Defaults to none.
--use-tabs Indent lines with tabs instead of spaces.
--use-tabs Indent with tabs instead of spaces.
Config options:
--config <path> Path to a prettier configuration file (.prettierrc, package.json, prettier.config.js).
--config <path> Path to a Prettier configuration file (.prettierrc, package.json, prettier.config.js).
--no-config Do not look for a configuration file.
--config-precedence <cli-override|file-override|prefer-file>
Defines how config file should be evaluated in combination of CLI options
Define in which order config files and CLI options should be evaluated
cli-override | default config => config file => CLI options
file-override | default config => CLI options => config file
prefer-file | default config => config file (if config file is found) or
default config => CLI options (if no config file is found)
Defaults to cli-override
--ignore-path <path> Path to a file containing patterns that describe files to ignore.
Defaults to cli-override.
--ignore-path <path> Path to a file with patterns describing files to ignore.
Defaults to ./.prettierignore.
--with-node-modules Process files inside 'node_modules' directory.
@ -114,9 +114,9 @@ Other options:
--no-color Do not colorize error messages.
--cursor-offset <int> Print (to stderr) where a cursor at the given position would move to after formatting.
This option cannot be used with --range-start and --range-end
This option cannot be used with --range-start and --range-end.
--stdin Read input from stdin.
--stdin-filepath <path> Path to the file used to read from stdin.
--stdin-filepath <path> Path to the file to pretend that stdin comes from.
"