136 lines
6.9 KiB
Plaintext
136 lines
6.9 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`show usage with --help 1`] = `
|
|
"Usage: prettier [opts] [filename ...]
|
|
|
|
Command options:
|
|
|
|
--find-config-path <path>
|
|
Find and print the path to a configuration file for the given input file.
|
|
--help or -h Show help.
|
|
--list-different or -l Print the names of files that are different from Prettier's formatting.
|
|
--version or -v Print Prettier version.
|
|
--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>
|
|
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.
|
|
Defaults to Infinity.
|
|
--range-start <int> Format code starting at a given character offset.
|
|
The range will extend backwards to the start of the first line containing the selected statement.
|
|
This option cannot be used with --cursor-offset.
|
|
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> 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 with tabs instead of spaces.
|
|
|
|
Config options:
|
|
|
|
--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>
|
|
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 with patterns describing files to ignore.
|
|
Defaults to ./.prettierignore.
|
|
--with-node-modules Process files inside 'node_modules' directory.
|
|
|
|
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.
|
|
--stdin Read input from stdin.
|
|
--stdin-filepath <path> Path to the file to pretend that stdin comes from.
|
|
|
|
|
|
"
|
|
`;
|
|
|
|
exports[`throw error and show usage with something unexpected 1`] = `
|
|
"Usage: prettier [opts] [filename ...]
|
|
|
|
Command options:
|
|
|
|
--find-config-path <path>
|
|
Find and print the path to a configuration file for the given input file.
|
|
--help or -h Show help.
|
|
--list-different or -l Print the names of files that are different from Prettier's formatting.
|
|
--version or -v Print Prettier version.
|
|
--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>
|
|
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.
|
|
Defaults to Infinity.
|
|
--range-start <int> Format code starting at a given character offset.
|
|
The range will extend backwards to the start of the first line containing the selected statement.
|
|
This option cannot be used with --cursor-offset.
|
|
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> 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 with tabs instead of spaces.
|
|
|
|
Config options:
|
|
|
|
--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>
|
|
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 with patterns describing files to ignore.
|
|
Defaults to ./.prettierignore.
|
|
--with-node-modules Process files inside 'node_modules' directory.
|
|
|
|
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.
|
|
--stdin Read input from stdin.
|
|
--stdin-filepath <path> Path to the file to pretend that stdin comes from.
|
|
|
|
|
|
"
|
|
`;
|
|
|
|
exports[`throw error and show usage with something unexpected 2`] = `""`;
|
|
|
|
exports[`throw error with --find-config-path + multiple files 1`] = `
|
|
"Cannot use --find-config-path with multiple files
|
|
"
|
|
`;
|
|
|
|
exports[`throw error with --write + --debug-check 1`] = `
|
|
"Cannot use --write and --debug-check together.
|
|
"
|
|
`;
|