diff --git a/jsx/lexer.py b/jsx/lexer.py index 9bc6ec7..22e9e1f 100644 --- a/jsx/lexer.py +++ b/jsx/lexer.py @@ -71,6 +71,18 @@ class JsxLexer(JavascriptLexer): tokens = JSX_TOKENS +class TsxLexer(TypeScriptLexer): + name = "react-typescript" + aliases = ["tsx", "react-typescript"] + filenames = ["*.tsx"] + mimetypes = ["text/tsx", "text/typescript-jsx"] + mimetypes = ["text/jsx"] + + flags = re.MULTILINE | re.DOTALL | re.UNICODE + + tokens = JSX_TOKENS + + class TsxLexer(TypeScriptLexer): name = "react-typescript" aliases = ["tsx", "react-typescript"]