Skip to content
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

Is there any way to configure TypeScript differently for specific files? #32284

Closed
newtykip opened this issue Jul 7, 2019 · 3 comments
Closed
Labels
Question An issue which isn't directly actionable in code

Comments

@newtykip
Copy link

newtykip commented Jul 7, 2019

Is there any way I can set my class file, Client.ts, to compile to ES6 whilst the rest compiles to ES5?

I was getting the error Class constructor Client cannot be invoked without 'new', so I set out to find an answer. According to this answer, I need to set my target to es6, so I did. That meant that Node could not run my code due to the fact that it was in ES6. Apparently, Node supports ES6 classes though, so how would I go about making only that file compile to ES6?

@MartinJohns
Copy link
Contributor

MartinJohns commented Jul 7, 2019

Kind of a duplicate of #8405 (or at least related).

This also seems to be a question. Please respect the issue template:
https://github.com/microsoft/TypeScript/blob/master/.github/ISSUE_TEMPLATE/Question.md

@RyanCavanaugh
Copy link
Member

Short answer is "no". Long answer is also "no" 😉

@RyanCavanaugh RyanCavanaugh added the Question An issue which isn't directly actionable in code label Jul 8, 2019
@newtykip newtykip closed this as completed Jul 9, 2019
@MartinJohns
Copy link
Contributor

@RyanCavanaugh Is there an answer between the short and the long one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

3 participants