Skip to content

Commit

Permalink
Do not force noEmit option into TypeScript configuration (#7451)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed May 29, 2019
1 parent 24034ec commit 5e2e978
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions packages/next/lib/verifyTypeScriptSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ export async function verifyTypeScriptSetup(dir: string): Promise<void> {
chalk.cyan.bold(toInstallStr),
'by running',
chalk.cyan.bold(
(isYarn ? 'yarn add --dev' : 'npm install --save-dev') + ' ' + toInstallStr,
(isYarn ? 'yarn add --dev' : 'npm install --save-dev') +
' ' +
toInstallStr,
) + '.',
),
)
Expand Down Expand Up @@ -119,6 +121,7 @@ export async function verifyTypeScriptSetup(dir: string): Promise<void> {
skipLibCheck: { suggested: true },
strict: { suggested: true },
forceConsistentCasingInFileNames: { suggested: true },
noEmit: { suggested: true },

// These values are required and cannot be changed by the user
// Keep this in sync with the webpack config
Expand All @@ -141,7 +144,6 @@ export async function verifyTypeScriptSetup(dir: string): Promise<void> {
value: true,
reason: 'requirement for babel',
},
noEmit: { value: true },
jsx: { parsedValue: ts.JsxEmit.Preserve, value: 'preserve' },
}

Expand Down Expand Up @@ -267,6 +269,16 @@ export async function verifyTypeScriptSetup(dir: string): Promise<void> {
}

if (toInstall.length > 0) {
console.warn(chalk.red(`\n${toInstall.join(' ')} ${toInstall.length === 1 ? 'is' : 'are'} needed when using TypeScript with Next.js. Please install ${toInstall.length === 1 ? 'it' : 'them'} with ${isYarn ? 'yarn add --dev' : 'npm install --save-dev'} ${toInstall.join(' ')}\n`))
console.warn(
chalk.red(
`\n${toInstall.join(' ')} ${
toInstall.length === 1 ? 'is' : 'are'
} needed when using TypeScript with Next.js. Please install ${
toInstall.length === 1 ? 'it' : 'them'
} with ${
isYarn ? 'yarn add --dev' : 'npm install --save-dev'
} ${toInstall.join(' ')}\n`,
),
)
}
}

0 comments on commit 5e2e978

Please sign in to comment.