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

feat(typescript): add an option to not rename all .js files to .ts and to set allowJs to true #4212

Merged
merged 5 commits into from Jul 3, 2019

Conversation

NataliaTepluhina
Copy link
Member

@NataliaTepluhina NataliaTepluhina commented Jun 30, 2019

What does this PR do?

Close #2676

At the moment when we run vue add, Vue CLI renames all *.js files to *.ts. This PR introduces two new prompts on @vue/cli-plugin-typescript late-invokation:

  1. convertJsToTs: if set to true, renames all .js files to .ts. Otherwise renames only main.js -> main.ts;
  2. allowJs: if set to true, adds allowJs: true to TSConfig compiler options.

@NataliaTepluhina
Copy link
Member Author

@Akryum @sodatea could you please take a look? 🙇‍♀

@NataliaTepluhina NataliaTepluhina changed the title Do not rename all *.js files to *.ts after running vue add @vue/typescript - give users a choice to enable allowJs:true mode Add an option to not rename all .js to .ts and to add allowJs: true Jun 30, 2019
@NataliaTepluhina NataliaTepluhina changed the title Add an option to not rename all .js to .ts and to add allowJs: true chore(typescript): add an option to not rename all .js to .ts and to set allowJs to true` Jun 30, 2019
@NataliaTepluhina NataliaTepluhina changed the title chore(typescript): add an option to not rename all .js to .ts and to set allowJs to true` chore(typescript): add an option to not rename all .js to .ts and to set allowJs to true Jun 30, 2019
@NataliaTepluhina NataliaTepluhina changed the title chore(typescript): add an option to not rename all .js to .ts and to set allowJs to true chore(typescript): add an option to not rename all .js files to .ts and to set allowJs to true Jun 30, 2019
@NataliaTepluhina NataliaTepluhina changed the title chore(typescript): add an option to not rename all .js files to .ts and to set allowJs to true feat(typescript): add an option to not rename all .js files to .ts and to set allowJs to true Jun 30, 2019
@sodatea sodatea merged commit 38debb4 into vuejs:dev Jul 3, 2019
sodatea pushed a commit that referenced this pull request Jul 3, 2019
Close #2676

At the moment when we run `vue add`, Vue CLI renames all `*.js` files to `*.ts`. This PR introduces two new prompts on `@vue/cli-plugin-typescript` late-invokation:

1. `convertJsToTs`: if set to `true`, renames all `.js` files to `.ts`. Otherwise renames only `main.js` -> `main.ts`;
2. `allowJs`: if set to `true`, adds `allowJs: true` to TSConfig compiler options.

(cherry picked from commit 38debb4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants