Skip to content

Commit efd73d1

Browse files
fix: move useState example to tsx
1 parent 97fe04a commit efd73d1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

website/catalog/tsx/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ They need different parsers because of [conflicting syntax](https://www.typescri
99
In order to reduce rule duplication, you can use the [`languageGlobs`](/reference/sgconfig.html#languageglobs) option to force ast-grep to use parse `.ts` files as TSX.
1010
:::
1111

12+
<!--@include: ./redundant-usestate-type.md-->
1213
<!--@include: ./avoid-jsx-short-circuit.md-->
1314
<!--@include: ./rewrite-mobx-component.md-->
1415
<!--@include: ./unnecessary-react-hook.md-->

website/catalog/typescript/redundant-usestate-type.md renamed to website/catalog/tsx/redundant-usestate-type.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ We can usually skip annotating if the generic type argument is a single primitiv
1313

1414
::: code-group
1515
```bash [number]
16-
ast-grep -p 'useState<number>($A)' -r 'useState($A)' -l ts
16+
ast-grep -p 'useState<number>($A)' -r 'useState($A)' -l tsx
1717
```
1818

1919
```bash [string]

website/catalog/typescript/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ However, you can use the [`languageGlobs`](/reference/sgconfig.html#languageglob
1313
<!--@include: ./find-import-file-without-extension.md-->
1414
<!--@include: ./migrate-xstate-v5.md-->
1515
<!--@include: ./no-await-in-promise-all.md-->
16-
<!--@include: ./no-console-except-catch.md-->
17-
<!--@include: ./redundant-usestate-type.md-->
16+
<!--@include: ./no-console-except-catch.md-->

0 commit comments

Comments
 (0)