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", type: "path",
category: CATEGORY_CONFIG, category: CATEGORY_CONFIG,
description: 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." oppositeDescription: "Do not look for a configuration file."
}, },
"config-precedence": { "config-precedence": {
@ -90,12 +90,12 @@ const detailedOptions = normalizeDetailedOptions({
default: "cli-override", default: "cli-override",
choices: ["cli-override", "file-override", "prefer-file"], choices: ["cli-override", "file-override", "prefer-file"],
description: dedent(` 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 cli-override | default config => config file => CLI options
file-override | default config => CLI options => config file file-override | default config => CLI options => config file
prefer-file | default config => config file (if config file is found) or prefer-file | default config => config file (if config file is found) or
default config => CLI options (if no config file is found) default config => CLI options (if no config file is found)
Defaults to cli-override Defaults to cli-override.
`) `)
}, },
"cursor-offset": { "cursor-offset": {
@ -104,7 +104,7 @@ const detailedOptions = normalizeDetailedOptions({
forwardToApi: true, forwardToApi: true,
description: dedent(` description: dedent(`
Print (to stderr) where a cursor at the given position would move to after formatting. 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": { "debug-check": {
@ -117,7 +117,7 @@ const detailedOptions = normalizeDetailedOptions({
type: "path", type: "path",
category: CATEGORY_COMMAND, category: CATEGORY_COMMAND,
description: 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": { "flow-parser": {
// Deprecated in 0.0.10 // Deprecated in 0.0.10
@ -136,7 +136,7 @@ const detailedOptions = normalizeDetailedOptions({
category: CATEGORY_CONFIG, category: CATEGORY_CONFIG,
default: ".prettierignore", default: ".prettierignore",
description: dedent(` 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. Defaults to ./.prettierignore.
`) `)
}, },
@ -151,23 +151,22 @@ const detailedOptions = normalizeDetailedOptions({
category: CATEGORY_COMMAND, category: CATEGORY_COMMAND,
alias: "l", alias: "l",
description: description:
"Print filenames of files that are different from Prettier formatting." "Print the names of files that are different from Prettier's formatting."
}, },
parser: { parser: {
type: "choice", type: "choice",
category: CATEGORY_FORMAT, category: CATEGORY_FORMAT,
forwardToApi: true, 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"], 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) getter: (value, argv) => (argv["flow-parser"] ? "flow" : value)
}, },
"print-width": { "print-width": {
type: "int", type: "int",
category: CATEGORY_FORMAT, category: CATEGORY_FORMAT,
forwardToApi: true, forwardToApi: true,
description: description: "The line length where Prettier will try wrap. Defaults to 80."
"Specify the length of line that the printer will wrap on. Defaults to 80."
}, },
"range-end": { "range-end": {
type: "int", type: "int",
@ -212,14 +211,13 @@ const detailedOptions = normalizeDetailedOptions({
"stdin-filepath": { "stdin-filepath": {
type: "path", type: "path",
forwardToApi: "filepath", 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": { "tab-width": {
type: "int", type: "int",
category: CATEGORY_FORMAT, category: CATEGORY_FORMAT,
forwardToApi: true, forwardToApi: true,
description: description: "Number of spaces per indentation level. Defaults to 2."
"Specify the number of spaces per indentation-level. Defaults to 2."
}, },
"trailing-comma": { "trailing-comma": {
type: "choice", type: "choice",
@ -238,7 +236,7 @@ const detailedOptions = normalizeDetailedOptions({
type: "boolean", type: "boolean",
category: CATEGORY_FORMAT, category: CATEGORY_FORMAT,
forwardToApi: true, forwardToApi: true,
description: "Indent lines with tabs instead of spaces." description: "Indent with tabs instead of spaces."
}, },
version: { version: {
type: "boolean", type: "boolean",
@ -254,7 +252,7 @@ const detailedOptions = normalizeDetailedOptions({
write: { write: {
type: "boolean", type: "boolean",
category: CATEGORY_COMMAND, 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: Command options:
--find-config-path <path> --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. --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. --version or -v Print Prettier version.
--write Edit the file in-place. (Beware!) --write Edit files in-place. (Beware!)
Format options: Format options:
--no-bracket-spacing Do not print spaces between brackets. --no-bracket-spacing Do not print spaces between brackets.
--jsx-bracket-same-line Put > on the last line instead of at a new line. --jsx-bracket-same-line Put > on the last line instead of at a new line.
--parser <flow|babylon|typescript|postcss|json|graphql> --parser <flow|babylon|typescript|postcss|json|graphql>
Specify which parser to use. Defaults to babylon. Which parser to use. Defaults to babylon.
--print-width <int> Specify the length of line that the printer will wrap on. Defaults to 80. --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). --range-end <int> Format code ending at a given character offset (exclusive).
The range will extend forwards to the end of the selected statement. The range will extend forwards to the end of the selected statement.
This option cannot be used with --cursor-offset. This option cannot be used with --cursor-offset.
@ -29,23 +29,23 @@ Format options:
Defaults to 0. Defaults to 0.
--no-semi Do not print semicolons, except at the beginning of lines which may need them. --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. --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> --trailing-comma <none|es5|all>
Print trailing commas wherever possible when multi-line. Defaults to none. 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 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. --no-config Do not look for a configuration file.
--config-precedence <cli-override|file-override|prefer-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 cli-override | default config => config file => CLI options
file-override | default config => CLI options => config file file-override | default config => CLI options => config file
prefer-file | default config => config file (if config file is found) or prefer-file | default config => config file (if config file is found) or
default config => CLI options (if no config file is found) default config => CLI options (if no config file is found)
Defaults to cli-override Defaults to cli-override.
--ignore-path <path> Path to a file containing patterns that describe files to ignore. --ignore-path <path> Path to a file with patterns describing files to ignore.
Defaults to ./.prettierignore. Defaults to ./.prettierignore.
--with-node-modules Process files inside 'node_modules' directory. --with-node-modules Process files inside 'node_modules' directory.
@ -53,9 +53,9 @@ Other options:
--no-color Do not colorize error messages. --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. --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 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: Command options:
--find-config-path <path> --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. --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. --version or -v Print Prettier version.
--write Edit the file in-place. (Beware!) --write Edit files in-place. (Beware!)
Format options: Format options:
--no-bracket-spacing Do not print spaces between brackets. --no-bracket-spacing Do not print spaces between brackets.
--jsx-bracket-same-line Put > on the last line instead of at a new line. --jsx-bracket-same-line Put > on the last line instead of at a new line.
--parser <flow|babylon|typescript|postcss|json|graphql> --parser <flow|babylon|typescript|postcss|json|graphql>
Specify which parser to use. Defaults to babylon. Which parser to use. Defaults to babylon.
--print-width <int> Specify the length of line that the printer will wrap on. Defaults to 80. --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). --range-end <int> Format code ending at a given character offset (exclusive).
The range will extend forwards to the end of the selected statement. The range will extend forwards to the end of the selected statement.
This option cannot be used with --cursor-offset. This option cannot be used with --cursor-offset.
@ -90,23 +90,23 @@ Format options:
Defaults to 0. Defaults to 0.
--no-semi Do not print semicolons, except at the beginning of lines which may need them. --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. --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> --trailing-comma <none|es5|all>
Print trailing commas wherever possible when multi-line. Defaults to none. 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 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. --no-config Do not look for a configuration file.
--config-precedence <cli-override|file-override|prefer-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 cli-override | default config => config file => CLI options
file-override | default config => CLI options => config file file-override | default config => CLI options => config file
prefer-file | default config => config file (if config file is found) or prefer-file | default config => config file (if config file is found) or
default config => CLI options (if no config file is found) default config => CLI options (if no config file is found)
Defaults to cli-override Defaults to cli-override.
--ignore-path <path> Path to a file containing patterns that describe files to ignore. --ignore-path <path> Path to a file with patterns describing files to ignore.
Defaults to ./.prettierignore. Defaults to ./.prettierignore.
--with-node-modules Process files inside 'node_modules' directory. --with-node-modules Process files inside 'node_modules' directory.
@ -114,9 +114,9 @@ Other options:
--no-color Do not colorize error messages. --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. --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 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.
" "