Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

checkJs: allow file extensions other than .js

See original GitHub issue

First of all, this option is super exciting! Thank you so much for the TypeScript team to make such an incredible tool ❤️

Surprisingly enough, this week I wanted to have type check in a *.jsfl file (Scripting for Adobe Animate) and it worked pretty well using Facebook’s Flow. They have an option to configure a different file format other than .js.

It would be nice to allow this sort of configuration for TypeScript as well. I’ve naively tried to use "include":["./src/*.jsfl"] but it didn’t worked. 😅

Or is there a hidden option for this? Thanks!

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:12
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

SMotaalcommented, Jun 1, 2018

I did a little experiment a while back where I carefully modified TypeScript’s source to add support for .mjs. I did this in a few hours and that included getting all the tests running.

I honestly had assumed from the push back that it is not that simple, but then I found that it is.

It became clear from further interactions that while it can be done, it cannot be supported in a way that meets the quality expectations from TypeScript.

If my PR would have been accepted, could my implementation have broken existing projects? In my opinion, that is the only problem that I completely considered beyond my scope as an external contributor.

Once again, imho, as a user not interested in or not expecting this new behaviour, all I expect from TypeScript is to lock it behind a flag so that only those who opt in and understand and accept the ramifications of “experimental support for other extensions” are affected by it. The other guy still wants it and the fact that it is not being addressed by TypeScript on par with the implications of the issue are extremely disappointing.

omeidcommented, May 17, 2017

The checkJs and allowJs merely adds complexity to the compiler, the simple solution would be to allow users to configure what files need be treat as TypeScript.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I get file extensions with JavaScript? - Stack Overflow
This is another non-regex solution that I think is more efficient: return filename.substring(filename.lastIndexOf('.')+1, filename.
Read more >
TSConfig Reference - Docs on every TSConfig option
The value of extends is a string which contains a path to another configuration file to inherit from. The path may use Node.js...
Read more >
Working with JavaScript in Visual Studio Code
To enable type checking for all JavaScript files without changing any code, just add "js/ts.implicitProjectConfig.checkJs": true to your workspace or user ...
Read more >
JavaScript modules - MDN Web Docs
This guide gives you all you need to get started with JavaScript module ... we've used .js extensions for our module files, but...
Read more >
File Upload - HackTricks
Add another layer of extensions to the previous check: ... files is inside a whitelist to assure that only allowed files are going...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found