mirror of
https://github.com/hanzoai/prettier.git
synced 2026-09-24 17:02:04 +00:00
a6bbdad8ca
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: fisker <[email protected]>
725 lines
15 KiB
Plaintext
725 lines
15 KiB
Plaintext
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
|
|
exports[`show detailed usage with --help arrow-parens 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--arrow-parens <always|avoid>
|
|
|
|
Include parentheses around a sole arrow function parameter.
|
|
|
|
Valid options:
|
|
|
|
always Always include parens. Example: \`(x) => x\`
|
|
avoid Omit parens when possible. Example: \`x => x\`
|
|
|
|
Default: always",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help bracket-same-line 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--bracket-same-line
|
|
|
|
Put > of opening tags on the last line instead of on a new line.
|
|
|
|
Default: false",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help bracket-spacing 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--bracket-spacing
|
|
|
|
Print spaces between brackets.
|
|
|
|
Default: true",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help cache 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--cache
|
|
|
|
Only format changed files. Cannot use with --stdin-filepath.
|
|
|
|
Default: false",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help cache-location 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--cache-location <path>
|
|
|
|
Path to the cache file.",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help cache-strategy 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--cache-strategy <metadata|content>
|
|
|
|
Strategy for the cache to use for detecting changed files.
|
|
|
|
Valid options:
|
|
|
|
metadata Use the file metadata such as timestamps as cache keys
|
|
content Use the file content as cache keys",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help check 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "-c, --check
|
|
|
|
Check if the given files are formatted, print a human-friendly summary
|
|
message and paths to unformatted files (see also --list-different).",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help check-ignore-pragma 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--check-ignore-pragma
|
|
|
|
Check whether the file's first docblock comment contains '@noprettier' or '@noformat' to determine if it should be formatted.
|
|
|
|
Default: false",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help color 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--color
|
|
|
|
Colorize error messages.
|
|
|
|
Default: true",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help config 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--config <path>
|
|
|
|
Path to a Prettier configuration file (.prettierrc, package.json, prettier.config.js).",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help config-precedence 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--config-precedence <cli-override|file-override|prefer-file>
|
|
|
|
Define in which order config files and CLI options should be evaluated.
|
|
|
|
Valid options:
|
|
|
|
cli-override CLI options take precedence over config file
|
|
file-override Config file take precedence over CLI options
|
|
prefer-file If a config file is found will evaluate it and ignore other CLI options.
|
|
If no config file is found CLI options will evaluate as normal.
|
|
|
|
Default: cli-override",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help cursor-offset 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--cursor-offset <int>
|
|
|
|
Print (to stderr) where a cursor at the given position would move to after formatting.
|
|
|
|
Default: -1",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help editorconfig 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--editorconfig
|
|
|
|
Take .editorconfig into account when parsing configuration.
|
|
|
|
Default: true",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help embedded-language-formatting 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--embedded-language-formatting <auto|off>
|
|
|
|
Control how Prettier formats quoted code embedded in the file.
|
|
|
|
Valid options:
|
|
|
|
auto Format embedded code if Prettier can automatically identify it.
|
|
off Never automatically format embedded code.
|
|
|
|
Default: auto",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help end-of-line 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--end-of-line <lf|crlf|cr|auto>
|
|
|
|
Which end of line characters to apply.
|
|
|
|
Valid options:
|
|
|
|
lf Line Feed only (\\n), common on Linux and macOS as well as inside git repos
|
|
crlf Carriage Return + Line Feed characters (\\r\\n), common on Windows
|
|
cr Carriage Return character only (\\r), used very rarely
|
|
auto Maintain existing
|
|
(mixed values within one file are normalised by looking at what's used after the first line)
|
|
|
|
Default: lf",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help experimental-operator-position 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--experimental-operator-position <start|end>
|
|
|
|
Where to print operators when binary expressions wrap lines.
|
|
|
|
Valid options:
|
|
|
|
start Print operators at the start of new lines.
|
|
end Print operators at the end of previous lines.
|
|
|
|
Default: end",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help experimental-ternaries 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--experimental-ternaries
|
|
|
|
Use curious ternaries, with the question mark after the condition.
|
|
|
|
Default: false",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help file-info 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--file-info <path>
|
|
|
|
Extract the following info (as JSON) for a given file path. Reported fields:
|
|
* ignored (boolean) - true if file path is filtered by --ignore-path
|
|
* inferredParser (string | null) - name of parser inferred from file path",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help find-config-path 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--find-config-path <path>
|
|
|
|
Find and print the path to a configuration file for the given input file.",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help help 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "-h, --help <flag>
|
|
|
|
Show CLI usage, or details about the given flag.
|
|
Example: --help write",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help html-whitespace-sensitivity 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--html-whitespace-sensitivity <css|strict|ignore>
|
|
|
|
How to handle whitespaces in HTML.
|
|
|
|
Valid options:
|
|
|
|
css Respect the default value of CSS display property.
|
|
strict Whitespaces are considered sensitive.
|
|
ignore Whitespaces are considered insensitive.
|
|
|
|
Default: css",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help ignore-path 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--ignore-path <path>
|
|
|
|
Path to a file with patterns describing files to ignore.
|
|
Multiple values are accepted.
|
|
|
|
Default: [.gitignore, .prettierignore]",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help ignore-unknown 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "-u, --ignore-unknown
|
|
|
|
Ignore unknown files.",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help insert-pragma 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--insert-pragma
|
|
|
|
Insert @format pragma into file's first docblock comment.
|
|
|
|
Default: false",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help jsx-single-quote 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--jsx-single-quote
|
|
|
|
Use single quotes in JSX.
|
|
|
|
Default: false",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help list-different 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "-l, --list-different
|
|
|
|
Print the names of files that are different from Prettier's formatting (see also --check).",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help log-level 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--log-level <silent|error|warn|log|debug>
|
|
|
|
What level of logs to report.
|
|
|
|
Valid options:
|
|
|
|
silent
|
|
error
|
|
warn
|
|
log
|
|
debug
|
|
|
|
Default: log",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help no-bracket-spacing 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--no-bracket-spacing
|
|
|
|
Do not print spaces between brackets.",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help no-color 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--no-color
|
|
|
|
Do not colorize error messages.",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help no-config 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--no-config
|
|
|
|
Do not look for a configuration file.",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help no-editorconfig 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--no-editorconfig
|
|
|
|
Don't take .editorconfig into account when parsing configuration.",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help no-error-on-unmatched-pattern 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--no-error-on-unmatched-pattern
|
|
|
|
Prevent errors when pattern is unmatched.",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help no-experimental-ternaries 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--no-experimental-ternaries
|
|
|
|
Default behavior of ternaries; keep question marks on the same line as the consequent.",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help no-semi 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--no-semi
|
|
|
|
Do not print semicolons, except at the beginning of lines which may need them.",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help object-wrap 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--object-wrap <preserve|collapse>
|
|
|
|
How to wrap object literals.
|
|
|
|
Valid options:
|
|
|
|
preserve Keep as multi-line, if there is a newline between the opening brace and first property.
|
|
collapse Fit to a single line when possible.
|
|
|
|
Default: preserve",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help parser 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--parser <flow|babel|babel-flow|babel-ts|typescript|acorn|espree|meriyah|css|less|scss|json|json5|jsonc|json-stringify|graphql|markdown|mdx|vue|yaml|glimmer|html|angular|lwc|mjml>
|
|
|
|
Which parser to use.
|
|
|
|
Valid options:
|
|
|
|
flow Flow
|
|
babel JavaScript
|
|
babel-flow Flow
|
|
babel-ts TypeScript
|
|
typescript TypeScript
|
|
acorn JavaScript
|
|
espree JavaScript
|
|
meriyah JavaScript
|
|
css CSS
|
|
less Less
|
|
scss SCSS
|
|
json JSON
|
|
json5 JSON5
|
|
jsonc JSON with Comments
|
|
json-stringify JSON.stringify
|
|
graphql GraphQL
|
|
markdown Markdown
|
|
mdx MDX
|
|
vue Vue
|
|
yaml YAML
|
|
glimmer Ember / Handlebars
|
|
html HTML
|
|
angular Angular
|
|
lwc Lightning Web Components
|
|
mjml MJML",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help plugin 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--plugin <path>
|
|
|
|
Add a plugin. Multiple plugins can be passed as separate \`--plugin\`s.
|
|
|
|
Default: []",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help print-width 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--print-width <int>
|
|
|
|
The line length where Prettier will try wrap.
|
|
|
|
Default: 80",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help prose-wrap 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--prose-wrap <always|never|preserve>
|
|
|
|
How to wrap prose.
|
|
|
|
Valid options:
|
|
|
|
always Wrap prose if it exceeds the print width.
|
|
never Do not wrap prose.
|
|
preserve Wrap prose as-is.
|
|
|
|
Default: preserve",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help quote-props 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--quote-props <as-needed|consistent|preserve>
|
|
|
|
Change when properties in objects are quoted.
|
|
|
|
Valid options:
|
|
|
|
as-needed Only add quotes around object properties where required.
|
|
consistent If at least one property in an object requires quotes, quote all properties.
|
|
preserve Respect the input use of quotes in object properties.
|
|
|
|
Default: as-needed",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help range-end 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--range-end <int>
|
|
|
|
Format code ending at a given character offset (exclusive).
|
|
The range will extend forwards to the end of the selected statement.
|
|
|
|
Default: Infinity",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help range-start 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--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.
|
|
|
|
Default: 0",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help require-pragma 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--require-pragma
|
|
|
|
Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.
|
|
|
|
Default: false",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help semi 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--semi
|
|
|
|
Print semicolons.
|
|
|
|
Default: true",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help single-attribute-per-line 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--single-attribute-per-line
|
|
|
|
Enforce single attribute per line in HTML, Vue and JSX.
|
|
|
|
Default: false",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help single-quote 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--single-quote
|
|
|
|
Use single quotes instead of double quotes.
|
|
|
|
Default: false",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help stdin-filepath 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--stdin-filepath <path>
|
|
|
|
Path to the file to pretend that stdin comes from.",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help support-info 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--support-info
|
|
|
|
Print support information as JSON.",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help tab-width 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--tab-width <int>
|
|
|
|
Number of spaces per indentation level.
|
|
|
|
Default: 2",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help trailing-comma 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--trailing-comma <all|es5|none>
|
|
|
|
Print trailing commas wherever possible when multi-line.
|
|
|
|
Valid options:
|
|
|
|
all Trailing commas wherever possible (including function arguments).
|
|
es5 Trailing commas where valid in ES5 (objects, arrays, etc.)
|
|
none No trailing commas.
|
|
|
|
Default: all",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help use-tabs 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--use-tabs
|
|
|
|
Indent with tabs instead of spaces.
|
|
|
|
Default: false",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help version 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "-v, --version
|
|
|
|
Print Prettier version.",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help vue-indent-script-and-style 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--vue-indent-script-and-style
|
|
|
|
Indent script and style tags in Vue files.
|
|
|
|
Default: false",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help with-node-modules 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "--with-node-modules
|
|
|
|
Process files inside 'node_modules' directory.",
|
|
"write": [],
|
|
}
|
|
`;
|
|
|
|
exports[`show detailed usage with --help write 1`] = `
|
|
{
|
|
"stderr": "",
|
|
"stdout": "-w, --write
|
|
|
|
Edit files in-place. (Beware!)",
|
|
"write": [],
|
|
}
|
|
`;
|