Typescript project files named js

I created a new ionic project with latest ionic framework doing

ionic start cutePuppyPics --v2

but in the new project which should be a typescipt project the typscript angular2 files are named as “.js” and not “.ts” as before and as standard?

Why that?

1 Like

You need to add the --ts flag to your command.

So it would be something like this:
ionic start cutePuppyPics --v2 --ts

@ihadeed yea, but I think ionic documentation changed, now I found this in docu


“Ionic 2 applications are created as TypeScript by default” … “Want to use JavaScript instead? Pass the --no-ts flag and get a project set up for JavaScript instead.”

So I think the behavior changed, but it doesn’t work? Or what’s happened?

1 Like

Oh, I wasn’t aware of that. I still use --ts when I create apps, and they come out right.

It might be an issue with the CLI, or your CLI might be outdated.

Nohting outdate

Package Current Wanted Latest Location
ionic 2.0.0-beta.30 2.0.0-beta.30 1.7.15

also ionic-angular is on beta.8

But I think the --ts should work, but so in this case the documentation or the cli are wrong.

That’s strange!

Well, at least the --ts flag is working :smiley:

Having the same issue. --ts flag is working, but the documentation is misleading.

The new edition of cli lookes like changing to js as default.

hm? I think it’s not right what @zhangpeimingsays, the cli always has js as default. But now the documentation writes typescript is the standard but the cli continues to use js as standard. So I think the documentation is misleading now or the documentation changed but the new cli standard is not released yet?

Maybe the cli changed,and the document hadn`t followed yet.

I’m pretty sure the document changed, so before in the documentation was described we have to set --ts for typescript. And now the documentation write --ts is set by default but the cli works still with js as default.

You’re right. Looking at the following commit it seems that the documentation was updated although the CLI still doesn’t work this way. Judging by the following open issue the transition to TypeScript as default is still a work in progress:

1 Like

I’m on the latest CLI (2.0.0-beta.31), and I can’t generate a JS project:

  • No flags generates .ts files.
  • –no-ts flag generates .ts files.
  • –js flag generates .ts files.

I understand the default will be TS going forward, but we definitely should still be able to optionally generate a project using JS.

5 Likes

The same with me. No way to generate .js files instead of .ts files.

The tutorial is written with .js file snippets and it’s a little hard to follow it with the generated TS project.

Our long JavaScript nightmare is finally over.

@withinsight @albertorcf Check out the following post (and the linked post for details):

1 Like

I have updated the documentation for this today. Should be live soon. https://github.com/driftyco/ionic-site/commit/83175e663f1a0293445a5523bc4b4f61ea7d0458

All new v2 projects started will be TypeScript. We have removed the option to generate new projects using JavaScript. I have removed any reference to the --js, --no-ts, or --ts flags because they are no longer relevant.

2 Likes

I don’t like TypeScript coding style. It is like C#, it is Microsoft coding.
So, what I have to do?
I would like to use JS, not TypeScript.

2 Likes

So let’s go back using Ionic v1, guys :smiley:
And let’s hope they do not delete it… They have a very strange attitude… No compatibility is like going back to '90

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)