Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix help text indentation #4531

Merged
merged 4 commits into from
Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ const meowOptions = {
Input: Files(s), glob(s), or nothing to use stdin.

If an input argument is wrapped in quotation marks, it will be passed to
globby for cross-platform glob support. node_modules are always ignored.
You can also pass no input and use stdin, instead.
globby for cross-platform glob support. node_modules are always ignored.
You can also pass no input and use stdin, instead.

Options:

Expand Down
139 changes: 139 additions & 0 deletions system-tests/cli/__snapshots__/cli.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`CLI --help 1`] = `
"
A mighty, modern CSS linter.

Usage: stylelint [input] [options]

Input: Files(s), glob(s), or nothing to use stdin.

If an input argument is wrapped in quotation marks, it will be passed to
globby for cross-platform glob support. node_modules are always ignored.
You can also pass no input and use stdin, instead.

Options:

--config

Path to a specific configuration file (JSON, YAML, or CommonJS), or the
name of a module in node_modules that points to one. If no --config
argument is provided, stylelint will search for configuration files in
the following places, in this order:
- a stylelint property in package.json
- a .stylelintrc file (with or without filename extension:
.json, .yaml, .yml, and .js are available)
- a stylelint.config.js file exporting a JS object
The search will begin in the working directory and move up the directory
tree until a configuration file is found.

--config-basedir

An absolute path to the directory that relative paths defining \\"extends\\"
and \\"plugins\\" are *relative to*. Only necessary if these values are
relative paths.

--print-config

Print the configuration for the given path.

--ignore-path, -i

Path to a file containing patterns that describe files to ignore. The
path can be absolute or relative to process.cwd(). By default, stylelint
looks for .stylelintignore in process.cwd().

--ignore-pattern, --ip

Pattern of files to ignore (in addition to those in .stylelintignore)

--syntax, -s

Specify a syntax. Options: \\"css\\", \\"css-in-js\\", \\"html\\", \\"less\\",
\\"markdown\\", \\"sass\\", \\"scss\\", \\"sugarss\\". If you do not specify a syntax,
syntaxes will be automatically inferred by the file extensions
and file content.

--fix

Automatically fix violations of certain rules.

--custom-syntax

Module name or path to a JS file exporting a PostCSS-compatible syntax.

--stdin-filename

A filename to assign stdin input.

--ignore-disables, --id

Ignore styleline-disable comments.

--disable-default-ignores, --di

Allow linting of node_modules.

--cache [default: false]

Store the info about processed files in order to only operate on the
changed ones the next time you run stylelint. By default, the cache
is stored in \\"./.stylelintcache\\". To adjust this, use --cache-location.

--cache-location [default: '.stylelintcache']

Path to a file or directory to be used for the cache location.
Default is \\"./.stylelintcache\\". If a directory is specified, a cache
file will be created inside the specified folder, with a name derived
from a hash of the current working directory.

If the directory for the cache does not exist, make sure you add a trailing \\"/\\"
on *nix systems or \\"\\\\\\" on Windows. Otherwise the path will be assumed to be a file.

--formatter, -f [default: \\"string\\"]

The output formatter: \\"compact\\", \\"json\\", \\"string\\", \\"unix\\" or \\"verbose\\".

--custom-formatter

Path to a JS file exporting a custom formatting function.

--quiet, -q

Only register violations for rules with an \\"error\\"-level severity (ignore
\\"warning\\"-level).

--color
--no-color

Force enabling/disabling of color.

--report-needless-disables, --rd

Also report errors for stylelint-disable comments that are not blocking a lint warning.
The process will exit with code 2 if needless disables are found.

--report-invalid-scope-disables, --risd

Report stylelint-disable comments that used for rules that don't exist within the configuration object.
The process will exit with code 2 if invalid scope disables are found.

--max-warnings, --mw

Number of warnings above which the process will exit with code 2.
Useful when setting \\"defaultSeverity\\" to \\"warning\\" and expecting the
process to fail on warnings (e.g. CI build).

--output-file, -o

Path of file to write report.

--version, -v

Show the currently installed version of stylelint.

--allow-empty-input, --aei

When glob pattern matches no files, the process will exit without throwing an error.
"
`;
2 changes: 1 addition & 1 deletion system-tests/cli/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('CLI', () => {
const lastCallArgs = console.log.mock.calls.pop();

expect(lastCallArgs).toHaveLength(1);
expect(lastCallArgs.pop()).toMatch('Usage: stylelint [input] [options]');
expect(lastCallArgs.pop()).toMatchSnapshot();
});
});

Expand Down