Skip to content

Commit 97fe04a

Browse files
fix: update ts file warning
1 parent 27c4107 commit 97fe04a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

website/catalog/tsx/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This page curates a list of example ast-grep rules to check and to rewrite TypeS
66
TypeScript is a typed JavaScript extension and TSX is a further extension that allows JSX elements.
77
They need different parsers because of [conflicting syntax](https://www.typescriptlang.org/docs/handbook/jsx.html#the-as-operator).
88

9-
TS allows both the `as` operator and angle brackets (`<>`) for type assertions. While TSX only allows the `as` operator because it interprets angle brackets as JSX elements.
9+
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

1212
<!--@include: ./avoid-jsx-short-circuit.md-->

website/catalog/typescript/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Check out the [Repository of ESLint rules](https://github.com/ast-grep/eslint/)
77
TypeScript is a typed JavaScript extension and TSX is a further extension that allows JSX elements.
88
They need different parsers because of [conflicting syntax](https://www.typescriptlang.org/docs/handbook/jsx.html#the-as-operator).
99

10-
TS allows both the `as` operator and angle brackets (`<>`) for type assertions. While TSX only allows the `as` operator because it interprets angle brackets as JSX elements.
10+
However, you can use the [`languageGlobs`](/reference/sgconfig.html#languageglobs) option to force ast-grep to use parse `.ts` files as TSX.
1111
:::
1212

1313
<!--@include: ./find-import-file-without-extension.md-->

0 commit comments

Comments
 (0)