tspath icon indicating copy to clipboard operation
tspath copied to clipboard

Non compat products

Open ilDon opened this issue 7 years ago • 1 comments

I was experiencing some weird behaviour when running with node 8.9.3 (in Electron).

After some testing, I've found out that disabling the compat option when calling escodegen.generate solves the issue. This might also be related to the shaky behaviour with node 9.x.

To solve this, I've made the compat formatting optional, now it is applied if -c is passed via CLI.

To better handle params, I've also rewritten parseCommandLineParam as a static public method of TSPath, as it was not used before. Now parseCommandLineParam expects 1 argument, the name of the parameter (e.g. -f), and it returns the parameter or null (e.g. -f | null).

This new method is used both in the parser engine to detect the -c option, and in TsPath to detect the -f option.

With this pull request I've also committed some changes to parent-file-finder.ts. There I've added as "/" | "\\" to prevent tsc from throwing an error when running build.

Finally, I've updated the Options table in the readme file.

PS @duffman if you need any help maintaining this project, I'm happy to help.

ilDon avatar Sep 04 '18 17:09 ilDon

ilDon, interesting find, the compat mode, I will look into that! Sounds great that you´re interested in helping out with the project, I sure could be more active :) As of your pull requests I can tell you have put some time into this and that´s great, from those pull requests I can also see that we should have a quick chat of how I saw this organized in my mind when I wrote it :)

As for a few of your pull requests it´s too bad I´ve been so unavailable here so a few things you have built on have changed and some things have already been implemented directly in my local dev branch, like the command line stuff.

It would be nice to have some help maintaining it!

duffman avatar Sep 13 '18 11:09 duffman

Hi duffman! Great that you merged the PR :-) Sorry that I did not reply to your message so long ago, I just saw it actually. Nevertheless I'm happy to see the project being active :-)

ilDon avatar Sep 23 '22 14:09 ilDon