File tree 2 files changed +16
-10
lines changed
2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,11 @@ class CreateJavascriptProject extends Command {
28
28
await checkPackageJson ( ) ;
29
29
const answers = await collectAnswers ( ) ;
30
30
31
- if ( answers . configurations . includes ( "flow" ) || answers . framework !== "none" ) {
31
+ if (
32
+ answers . configurations . includes ( "flow" ) ||
33
+ answers . typescript ||
34
+ answers . framework !== "none"
35
+ ) {
32
36
answers . module = "esm" ;
33
37
}
34
38
Original file line number Diff line number Diff line change @@ -51,22 +51,24 @@ export async function collectAnswers(): Promise<InquirerConfigs> {
51
51
{ name : "None" , value : "none" } ,
52
52
] ,
53
53
} ,
54
+ {
55
+ type : "confirm" ,
56
+ name : "typescript" ,
57
+ message : "Does your project use TypeScript?" ,
58
+ when : ( answers ) => ! answers . configurations . includes ( "flow" ) ,
59
+ } ,
54
60
{
55
61
type : "list" ,
56
62
name : "module" ,
57
- message : "What type of modules does your project use?" ,
63
+ message : "What type of module does your project use?" ,
58
64
choices : [
59
65
{ name : "JavaScript modules (import/export)" , value : "esm" } ,
60
66
{ name : "CommonJS (require/exports)" , value : "commonjs" } ,
61
67
] ,
62
- when : ( answers ) => ! answers . configurations . includes ( "flow" ) && answers . framework === "none" ,
63
- } ,
64
- {
65
- type : "confirm" ,
66
- name : "typescript" ,
67
- message : "Does your project use TypeScript?" ,
68
- when : ( answers ) => ! answers . configurations . includes ( "flow" ) && answers . module !== "commonjs" ,
69
- default : ( answers : InquirerConfigs ) => answers . framework !== "none" ,
68
+ when : ( answers ) =>
69
+ ! answers . configurations . includes ( "flow" ) &&
70
+ ! answers . typescript &&
71
+ answers . framework === "none" ,
70
72
} ,
71
73
{
72
74
type : "checkbox" ,
You can’t perform that action at this time.
0 commit comments