Skip to content

Commit 79768b6

Browse files
fix: remove ./ to reflect latest ast-grep change
1 parent 0a796c4 commit 79768b6

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

website/advanced/language-injection.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ sg run -p 'color: $COLOR'
4848

4949
ast-grep outputs this beautiful CLI report.
5050
```shell
51-
./test.html
51+
test.html
5252
2│ h1 { color: red; }
5353
```
5454

@@ -80,7 +80,7 @@ The command leverages built-in behaviors in ast-grep to handle language injectio
8080

8181
```sh
8282
warning[no-alert]: Prefer use appropriate custom UI instead of obtrusive alert call.
83-
┌─ ./test.html:8:3
83+
┌─ test.html:8:3
8484
8585
8 │ alert('hello world!')
8686
│ ^^^^^^^^^^^^^^^^^^^^^
@@ -165,7 +165,7 @@ sg -p 'background: $COLOR' -C 2
165165
It will produce the match result:
166166

167167
```shell
168-
./styled.js
168+
styled.js
169169
2│
170170
3│const Button = styled.button`
171171
4│ background: red;
@@ -230,7 +230,7 @@ Output
230230

231231
```sh
232232
help[test]:
233-
┌─ ./relay.js:8:7
233+
┌─ relay.js:8:7
234234
235235
8 │ ...ArtistDescription_artist
236236
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -242,4 +242,4 @@ By following these steps, you can effectively use ast-grep to search and analyze
242242

243243
This feature extends to various frameworks like [Vue](https://vuejs.org/) and [Svelte](https://svelte.dev/), enables searching for [SQL in React server actions](https://x.com/peer_rich/status/1717609270475194466), and supports new patterns like [Vue-Vine](https://x.com/hd_nvim/status/1815300932793663658).
244244

245-
Hope you enjoy the feature! Happy ast-grepping!
245+
Hope you enjoy the feature! Happy ast-grepping!

website/guide/project/lint-rule.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,24 +135,24 @@ Rules can be applied to only certain files in a codebase with `files`. `files` s
135135

136136
```yaml
137137
files:
138-
- "./tests/**"
139-
- "./integration_tests/test.py"
138+
- "tests/**"
139+
- "integration_tests/test.py"
140140
```
141141

142142
Similarly, you can use `ignores` to ignore applying a rule to certain files. `ignores` supports a list of glob patterns:
143143

144144
```yaml
145145
ignores:
146-
- "./tests/config/**"
146+
- "tests/config/**"
147147
```
148148

149149
:::tip They work together!
150150
`ignores` and `files` can be used together.
151151
:::
152152

153-
:::warning Don't forget `./`
153+
:::warning Don't add `./`
154154

155-
Be sure to add `./` to the beginning of your rules. ast-grep will not recognize the paths if you omit `./`.
155+
Be sure to remove `./` to the beginning of your rules. ast-grep will not recognize the paths if you add `./`.
156156

157157
:::
158158

website/guide/scan-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Run `sg scan` in your project, ast-grep will give you some beautiful scan report
9090

9191
```bash
9292
error[no-eval]: Add your rule message here....
93-
┌─ ./test.js:1:1
93+
┌─ test.js:1:1
9494
9595
1 │ eval('hello')
9696
│ ^^^^^^^^^^^^^

website/guide/tooling-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The format of the JSON output is an array of match objects.
5959
"column": 8
6060
}
6161
},
62-
"file": "./website/src/vite-env.d.ts",
62+
"file": "website/src/vite-env.d.ts",
6363
"replacement": "require",
6464
"language": "TypeScript"
6565
}

website/guide/tools/json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The format of the JSON output is an array of match objects. Below is an example
2323
"start": { "line": 303, "column": 2 },
2424
"end": { "line": 303, "column": 15 }
2525
},
26-
"file": "./crates/config/src/rule/mod.rs",
26+
"file": "crates/config/src/rule/mod.rs",
2727
"lines": " Some(matched)",
2828
"replacement": "None",
2929
"replacementOffsets": { "start": 10828, "end": 10841 },

website/reference/yaml.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ Glob patterns to specify that the rule only applies to matching files. It takes
215215
Example:
216216
```yaml
217217
files:
218-
- ./src/**/*.js
219-
- ./src/**/*.ts
218+
- src/**/*.js
219+
- src/**/*.ts
220220
```
221221

222222
### `ignores`
@@ -225,8 +225,8 @@ files:
225225

226226
```yaml
227227
ignores:
228-
- ./test/**/*.js
229-
- ./test/**/*.ts
228+
- test/**/*.js
229+
- test/**/*.ts
230230
```
231231

232232
Glob patterns that exclude rules from applying to files. It is superseded by `files` if both are specified.

0 commit comments

Comments
 (0)