Skip to content

Commit

Permalink
Merge branch 'add-typescript' of github.com:cad0p/jsx-lexer into add-…
Browse files Browse the repository at this point in the history
…typescript
  • Loading branch information
cad0p committed Apr 11, 2023
2 parents ddc01d2 + 44d96a4 commit a25fb32
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions jsx/lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Check failure on line 86 in jsx/lexer.py

View workflow job for this annotation

GitHub Actions / flake8

redefinition of unused 'TsxLexer' from line 74
name = "react-typescript"
aliases = ["tsx", "react-typescript"]
Expand Down

0 comments on commit a25fb32

Please sign in to comment.