When upgrading to Next.js 9 I received this message:
The following changes are being made to your tsconfig.json file:
- compilerOptions.skipLibCheck to be suggested value: true (this can be changed)
- compilerOptions.forceConsistentCasingInFileNames to be suggested value: true (this can be changed)
- compilerOptions.noEmit to be suggested value: true (this can be changed)
- compilerOptions.esModuleInterop must be true (requirement for babel)
- compilerOptions.module must be esnext (for dynamic import() support)
- compilerOptions.resolveJsonModule must be true
- compilerOptions.isolatedModules must be true (requirement for babel)
It's a bit weird that suggested changes are applied without any prompt. Even required modifications to any config file should not be applied without warning.
Wouldn't it make more sense to show a message letting the user know that these changes need to be made instead of forcibly making them for him? Or at least asking before modifying and creating files.
The user is also not informed at all that the exclude and include options in tsconfig.json are modified.
@alexharri Next.js 9's integrated TypeScript support is meant to be as helpful and automatic as possible.
Many of the flags applied in this message can be modified -- other are simply requirements that would fail the build otherwise if left omitted.
I'm not sure a prompt is warranted here, because answering "No" would just cancel the issued command and not allow you to start or build your application.
Do note, you may also freely adjust include and exclude! They're just given their default values if unset to provide more clarity into what's really happening with your configuration.
I'm not sure a prompt is warranted here, because answering "No" would just cancel the issued command and not allow you to start or build your application.
@Timer Stopping the build command might give me the opportunity to make sure my project folder is in a state where I feel confident having tools make automatic changes to my files. Like making sure all my changes are committed and checking out a new branch. Maybe you can add a prompt only when the working dir is not clean?