-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TSX support #1763
Add TSX support #1763
Conversation
Related to #601 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests. Follow step 4 of "How to add a Beautifier for a Language" from https://github.com/Glavin001/atom-beautify/blob/master/docs/add-languages-and-beautifiers.md#how-to-add-a-beautifier-for-a-language
@@ -31,7 +31,7 @@ module.exports = class JSBeautify extends Beautifier | |||
return new @Promise((resolve, reject) => | |||
try | |||
switch language | |||
when "JSON", "JavaScript", "JSX" | |||
when "JSON", "JavaScript", "JSX", "TSX" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TSX
is incorrect, since the language
in this case would actually be JSX
from languages/jsx.coffee
.
@@ -19,6 +19,7 @@ module.exports = { | |||
### | |||
extensions: [ | |||
"jsx", | |||
"tsx", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if adding to TypeScript
language would make more sense and have better support via the TypeScript Formatter: https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/typescript-formatter.coffee#L8
A few things to fix up before we can merge. Please let me know if you have any questions! Thank you for contributing! |
I think using https://github.com/vvakame/typescript-formatter would be more appropriate. |
Closing as no changes were made after request for changes. This can be reopened if someone intends to pick up where this left off. Thanks! |
support .tsx files
beautify them just like .jsx