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
{{ message }}
Repository navigation
Commit 342edce
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: website/docs/en/guide/cli/check.mdx
+6-30Lines changed: 6 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: 'Run linting and formatting checks together, with optional TypeScri
4
4
5
5
# check
6
6
7
-
The `rs check` command combines linting, formatting, and optional TypeScript type checking for the current project. By default, it runs [`rs lint`](./lint) followed by [`rs fmt --check`](./fmt#--check).
7
+
The `rs check` command runs lint and formatting checks for the current project, with optional TypeScript type checking.
8
8
9
9
## Usage
10
10
@@ -18,21 +18,11 @@ Pass files or directories to limit both linting and formatting to those paths:
18
18
rs check src/index.ts packages/utils
19
19
```
20
20
21
-
The same file arguments are passed to both commands, so the example above is equivalent to:
By default, `rs check` runs [`rs lint`](./lint) followed by [`rs fmt --check`](./fmt#--check). It reports issues without modifying files.
30
24
31
-
```bash
32
-
rs lint && rs fmt --check
33
-
```
34
-
35
-
Checks run sequentially. If linting fails, `rs check` stops without running the formatting check. The command exits successfully only when every enabled check passes.
25
+
Formatting is still checked if linting or type checking reports errors. The command exits successfully only when all enabled checks pass.
36
26
37
27
## Options
38
28
@@ -44,30 +34,16 @@ Automatically fix linting and formatting issues:
44
34
rs check --fix
45
35
```
46
36
47
-
This is equivalent to:
48
-
49
-
```bash
50
-
rs lint --fix && rs fmt --write
51
-
```
52
-
53
-
If linting still fails after applying available fixes, `rs check` stops without running the formatter.
37
+
This first runs `rs lint --fix` to apply available lint fixes. If linting and any enabled type checking pass, it then runs `rs fmt --write` to format the updated files.
54
38
55
39
### `--type-check`
56
40
57
-
Enable TypeScript type checking as part of linting:
41
+
Add `--type-check` to enable TypeScript type checking alongside linting:
58
42
59
43
```bash
60
44
rs check --type-check
61
45
```
62
46
63
-
This is equivalent to:
64
-
65
-
```bash
66
-
rs lint --type-check && rs fmt --check
67
-
```
68
-
69
-
Type checking is disabled when this option is omitted.
70
-
71
47
### `-h, --help`
72
48
73
49
Display usage and option information without running checks:
@@ -78,4 +54,4 @@ rs check --help
78
54
79
55
## Configuration
80
56
81
-
`rs check` has no separate `define.check()` configuration. It uses the linting configuration from [`define.lint()`](../configuration#define-lint) and the formatting configuration from [`define.fmt()`](../configuration#define-fmt).
57
+
`rs check` uses the linting configuration from [`define.lint()`](../configuration#define-lint) and the formatting configuration from [`define.fmt()`](../configuration#define-fmt).
0 commit comments