You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+12-14
Original file line number
Diff line number
Diff line change
@@ -81,38 +81,36 @@ See [Releases](https://github.com/okonet/lint-staged/releases).
81
81
82
82
## Command line flags
83
83
84
-
```bash
84
+
```
85
85
❯ npx lint-staged --help
86
86
Usage: lint-staged [options]
87
87
88
88
Options:
89
89
-V, --version output the version number
90
-
--allow-empty allow empty commits when tasks revert all staged changes
91
-
(default: false)
90
+
--allow-empty allow empty commits when tasks revert all staged changes (default: false)
91
+
-p, --concurrent <number|boolean> the number of tasks to run concurrently, or false for serial (default: true)
92
92
-c, --config [path] path to configuration file, or - to read from stdin
93
+
--cwd [path] run all tasks in specific directory, instead of the current
93
94
-d, --debug print additional debug information (default: false)
94
-
--no-stash disable the backup stash, and do not revert incase of
95
-
errors
96
-
-p, --concurrent <parallel tasks> the number of tasks to run concurrently, or false to run
97
-
tasks serially (default: true)
95
+
--no-stash disable the backup stash, and do not revert in case of errors
98
96
-q, --quiet disable lint-staged’s own console output (default: false)
99
97
-r, --relative pass relative filepaths to tasks (default: false)
100
-
-x, --shell [path] skip parsing of tasks for better shell support (default:
101
-
false)
102
-
-v, --verbose show task output even when tasks succeed; by default only
103
-
failed output is shown (default: false)
98
+
-x, --shell [path] skip parsing of tasks for better shell support (default: false)
99
+
-v, --verbose show task output even when tasks succeed; by default only failed output is shown
100
+
(default: false)
104
101
-h, --help display help for command
105
102
```
106
103
107
104
-**`--allow-empty`**: By default, when linter tasks undo all staged changes, lint-staged will exit with an error and abort the commit. Use this flag to allow creating empty git commits.
108
-
- **`--config [path]`**: Manually specify a path to a config file or npm package name. Note: when used, lint-staged won't perform the config file search and will print an error if the specified file cannot be found. If '-' is provided as the filename then the config will be read from stdin, allowing piping in the config like `cat my-config.json | npx lint-staged --config -`.
109
-
- **`--debug`**: Run in debug mode. When set, it does the following:
105
+
-**`--concurrent [number|boolean]`**: Controls the concurrency of tasks being run by lint-staged. **NOTE**: This does NOT affect the concurrency of subtasks (they will always be run sequentially). Possible values are:
110
106
- uses [debug](https://github.com/visionmedia/debug) internally to log additional information about staged files, commands being executed, location of binaries, etc. Debug logs, which are automatically enabled by passing the flag, can also be enabled by setting the environment variable `$DEBUG` to `lint-staged*`.
111
107
- uses [`verbose` renderer](https://github.com/SamVerschueren/listr-verbose-renderer) for `listr`; this causes serial, uncoloured output to the terminal, instead of the default (beautified, dynamic) output.
112
-
- **`--concurrent [number | (true/false)]`**: Controls the concurrency of tasks being run by lint-staged. **NOTE**: This does NOT affect the concurrency of subtasks (they will always be run sequentially). Possible values are:
113
108
-`false`: Run all tasks serially
114
109
-`true` (default) : _Infinite_ concurrency. Runs as many tasks in parallel as possible.
115
110
-`{number}`: Run the specified number of tasks in parallel, where `1` is equivalent to `false`.
111
+
-**`--config [path]`**: Manually specify a path to a config file or npm package name. Note: when used, lint-staged won't perform the config file search and will print an error if the specified file cannot be found. If '-' is provided as the filename then the config will be read from stdin, allowing piping in the config like `cat my-config.json | npx lint-staged --config -`.
112
+
-**`--cwd [path]`**: By default tasks run in the current working directory. Use the `--cwd some/directory` to override this. The path can be absolute or relative to the current working directory.
113
+
-**`--debug`**: Run in debug mode. When set, it does the following:
116
114
-**`--no-stash`**: By default a backup stash will be created before running the tasks, and all task modifications will be reverted in case of an error. This option will disable creating the stash, and instead leave all modifications in the index when aborting the commit.
117
115
-**`--quiet`**: Supress all CLI output, except from tasks.
118
116
-**`--relative`**: Pass filepaths relative to `process.cwd()` (where `lint-staged` runs) to tasks. Default is `false`.
0 commit comments