This feature makes the JS -> TypeScript migration easier
At the moment when we run @vue/typescript then vue CLI adds all required dependencies and creates all required configuration files - this is fine. But it also renames all *.js files to *.ts. IMO it doesn't help with anything. Such an automation only makes sense if we have a fresh Vue project, but if we already have an existing application, then it doesn't make the migration any easier. It's very unlikely that existing files will compile successfully. Missing types and different import syntax will cause lots of compilation failures.
So I suggest that after the vue add @vue/typescript command is executed:
allowJs: true mode.main.js file.allowJs: true is the best way to migrate a JS project to TypeScript progressively. Thanks to this we can still use existing JS modules as they are, write new modules in TypeScript, and migrate existing ones one by one.
It's not my personal opinion. Setting allowJs to true is recommended in the official Migration from Javascrtipt guide.
is the best way to migrate a JS project to TypeScript progressively
Sure. But vue create does create a fresh project, there's nothing to migrate.
If you want rot "copy over" an existing project into this new one, can't you set allowJs: true and add your old JavaScript files? You will remove all of the generated boilerplate files except maybe main(j|ts) anyway, right?
So I may be missing something? I don't the the problems you are speaking of.
This is not about creating a new project with vue-cli. This is for when you have an existing vue project and then call vue add @vue/typescript. Now all the .js files are renamed to .ts, which is not what I would have expected.
Also I get errors for those files, because obviously they are not proper typescript.
Oh, that's indeed a good point that I haven't had thought about!
Yes please
Any news on this?
I assume that #4212 was merged to v4.0.0-beta.0?
If so, then PR doesn't work for me. I do get the option to skip renaming, but all my files still get renamed.
Yeah, @varna, you are not mistaken. In convert.js the option is called convertAllFiles while everywhere else it is called convertJsToTs.
This is extremely annoying. Even in an existing project, when I run vue upgrade or vue add <plugin>, it renames all my .js files to .ts. Sometimes this is not good, as I'm using things like hygen which expects the necessary files to be JS, not TS (same applies for Storybook config file).
@ffxsam but I think this option has already been shipped since 3.10 or 4.0.0-beta.1?
@sodatea It doesn't seem so. I literally just upgraded my vue-cli 3.x project, and every time I ran vue add, it mass-renamed my files.
I'm using @vue/cli version 4.0.4.
vue add typescript?
Here's my screencast: https://asciinema.org/a/0JWOnwJZmlygrWbVw0i9gC5j1
Notice the last two prompts:

vue add typescript?
Here's my screencast: https://asciinema.org/a/0JWOnwJZmlygrWbVw0i9gC5j1Notice the last two prompts:
@sodatea Yeah, if you have @vue/cli-plugin-eslint in your devDependencies, the convertJsToTs prompt will be filtered, it looks like a bug. prompts.js#L40. A PR has been created. #6053
You are right about that @jeneser. That part of the code was meant to remove the tslint prompt, so was broken for a while and is completely unneeded today.
I have created a fix PR: https://github.com/vuejs/vue-cli/pull/6054
Most helpful comment
This is not about creating a new project with
vue-cli. This is for when you have an existing vue project and then callvue add @vue/typescript. Now all the.jsfiles are renamed to.ts, which is not what I would have expected.Also I get errors for those files, because obviously they are not proper typescript.