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
Copy file name to clipboardExpand all lines: website/catalog/tsx/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
This page curates a list of example ast-grep rules to check and to rewrite TypeScript with JSX syntax.
4
4
5
-
:::danger TypeScript and TSX are different.
6
-
TypeScript is a typed JavaScript extension and TSX is a further extension that allows JSX elements.
7
-
They need different parsers because of [conflicting syntax](https://www.typescriptlang.org/docs/handbook/jsx.html#the-as-operator).
5
+
:::danger TSX and TypeScript are different.
6
+
TSX differs from TypeScript because it is an extension of the latter that supports JSX elements.
7
+
They need distinct parsers because of [conflicting syntax](https://www.typescriptlang.org/docs/handbook/jsx.html#the-as-operator).
8
8
9
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.
0 commit comments