Skip to content

Commit

Permalink
docs(cli): suggest --run flag when using vitest related with `lin…
Browse files Browse the repository at this point in the history
…t-staged` (#2704)

Co-authored-by: Vladimir Sheremet <sleuths.slews0s@icloud.com>
  • Loading branch information
mkermani144 and sheremet-va committed Jan 23, 2023
1 parent 2a7f6f8 commit 8c625d2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/guide/cli.md
Expand Up @@ -40,6 +40,17 @@ Useful to run with [`lint-staged`](https://github.com/okonet/lint-staged) or wit
vitest related /src/index.ts /src/hello-world.js
```

::: tip
Don't forget that Vitest runs with enabled watch mode by default. If you are using tools like `lint-staged`, you should also pass `--run` option, so that command can exit normally.

```js
// .lintstagedrc.js
export default {
'*.{js,ts}': 'vitest related --run',
}
```
:::

## Options

| Options | |
Expand Down

0 comments on commit 8c625d2

Please sign in to comment.