Skip to content

Commit

Permalink
Fix --print-config description in CLI help
Browse files Browse the repository at this point in the history
The `--print-config` option never requires an argument. For example:

```console
$ bin/stylelint.js --print-config -c scripts/visual-config.json scripts/visual.css
{
  "rules": {
...
```

On the other hand, the following example is mistaken:

```console
$ bin/stylelint.js --print-config scripts/visual-config.json
Error: No configuration provided for /Users/masafumi.koba/git/stylelint/stylelint/scripts/visual-config.json
...
```
  • Loading branch information
ybiquitous committed Jun 10, 2023
1 parent 7f51872 commit b339295
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/sixty-masks-sip.md
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed' `--print-config` description in CLI help
2 changes: 1 addition & 1 deletion docs/user-guide/cli.md
Expand Up @@ -94,7 +94,7 @@ Path of file to write a report. Stylelint outputs the report to the specified `f

### `--print-config`

Print the configuration for the given path. Stylelint outputs the configuration used for the file passed.
Print the configuration for the given input path.

### `--quiet, -q`

Expand Down
4 changes: 2 additions & 2 deletions lib/__tests__/__snapshots__/cli.test.js.snap
Expand Up @@ -35,9 +35,9 @@ exports[`CLI --help 1`] = `
"plugins", and "customSyntax" are *relative to*. Only necessary if these
values are relative paths.
--print-config <path>
--print-config
Print the configuration for the given path.
Print the configuration for the given input file path. Globs are unsupported.
--ignore-path, -i <path>
Expand Down
4 changes: 2 additions & 2 deletions lib/cli.js
Expand Up @@ -126,9 +126,9 @@ const meowOptions = {
"plugins", and "customSyntax" are *relative to*. Only necessary if these
values are relative paths.
--print-config <path>
--print-config
Print the configuration for the given path.
Print the configuration for the given input file path. Globs are unsupported.
--ignore-path, -i <path>
Expand Down

0 comments on commit b339295

Please sign in to comment.