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 11e0332
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: website/docs/en/guide/formatting.mdx
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,6 +103,8 @@ define.fmt({
103
103
104
104
Patterns follow Gitignore syntax and are resolved relative to the directory containing the Rstack configuration file. Because they are applied after the files are selected, they also exclude files passed explicitly on the command line.
105
105
106
+
By default, `rs fmt` ignores `.yarn/releases/` directories at any depth, which contain Yarn CLI distributions. To format these files, add `'!**/.yarn/releases/'` to `ignorePatterns` to re-include their directories.
107
+
106
108
### Lock files
107
109
108
110
By default, `rs fmt` ignores common lock files, including `package-lock.json`, `pnpm-lock.yaml`, and `skills-lock.json`.
@@ -122,7 +124,7 @@ define.fmt({
122
124
`rs fmt` uses the following three steps to decide which paths to format:
123
125
124
126
1.**Process command-line arguments and `.gitignore`**: It first processes the files, directories, and glob patterns passed on the command line. A glob that starts with `!` excludes matching paths. Directory and glob scans follow `.gitignore`, while files passed directly do not. Paths excluded in this step cannot be re-included later.
125
-
2.**Apply default ignore rules and `ignorePatterns`**: By default, the command ignores [lock files](#lock-files), then applies `ignorePatterns`. These rules are evaluated in order, with later rules taking precedence. For example, `!pnpm-lock.yaml` re-includes the otherwise ignored file.
127
+
2.**Apply default ignore rules and `ignorePatterns`**: By default, the command ignores [lock files](#lock-files) and `.yarn/releases/` directories, then applies `ignorePatterns`. These rules are evaluated in order, with later rules taking precedence. For example, `!pnpm-lock.yaml` re-includes the otherwise ignored file.
126
128
3.**Apply files specified with [`--ignore-path`](./cli/fmt#--ignore-path-path)**: Each ignore file is evaluated separately, and later rules take precedence within that file. Exclusions from different files and `ignorePatterns` are combined: if any source ignores a path, that path remains excluded, even if another source re-includes it.
127
129
128
130
> Even when a file is passed directly on the command line, the default ignore rules, `ignorePatterns`, and rules from `--ignore-path` still apply. The same is true for paths specified with [`--stdin-filepath`](./cli/fmt#--stdin-filepath-path) and for documents formatted through [`--lsp`](./cli/fmt#--lsp).
0 commit comments