Unverified Commit 42227559 authored by stefanprobst's avatar stefanprobst Committed by GitHub

fix: don't add forceConsistentCasingInFileNames to tsconfig when ts version >= 5.0 (#51564)



Currently, Next.js enforces that `forceConsistentCasingInFileNames: true` is added to a user's `tsconfig.json`.

This PR removes that behavior for CNA templates, and when the typescript version is >= 5.0.0, because since ts 5.0 `forceConsistentCasingInFileNames` is `true` by default. See https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/

related: https://github.com/vercel/next.js/issues/45617
parent 47e6b180
......@@ -5,7 +5,6 @@
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
......
......@@ -5,7 +5,6 @@
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
......
......@@ -5,7 +5,6 @@
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
......
......@@ -5,7 +5,6 @@
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
......
......@@ -28,7 +28,9 @@ function getDesiredCompilerOptions(
allowJs: { suggested: true },
skipLibCheck: { suggested: true },
strict: { suggested: false },
forceConsistentCasingInFileNames: { suggested: true },
...(semver.lt(ts.version, '5.0.0')
? { forceConsistentCasingInFileNames: { suggested: true } }
: undefined),
noEmit: { suggested: true },
...(semver.gte(ts.version, '4.4.2')
? { incremental: { suggested: true } }
......
......@@ -34,7 +34,6 @@ describe('tsconfig.json verifier', () => {
\\"allowJs\\": true,
\\"skipLibCheck\\": true,
\\"strict\\": false,
\\"forceConsistentCasingInFileNames\\": true,
\\"noEmit\\": true,
\\"incremental\\": true,
\\"esModuleInterop\\": true,
......@@ -89,7 +88,6 @@ describe('tsconfig.json verifier', () => {
\\"allowJs\\": true,
\\"skipLibCheck\\": true,
\\"strict\\": false,
\\"forceConsistentCasingInFileNames\\": true,
\\"noEmit\\": true,
\\"incremental\\": true,
\\"esModuleInterop\\": true,
......@@ -163,7 +161,6 @@ describe('tsconfig.json verifier', () => {
\\"allowJs\\": true,
\\"skipLibCheck\\": true,
\\"strict\\": false,
\\"forceConsistentCasingInFileNames\\": true,
\\"noEmit\\": true,
\\"incremental\\": true,
\\"moduleResolution\\": \\"node\\",
......@@ -218,7 +215,6 @@ describe('tsconfig.json verifier', () => {
\\"allowJs\\": true,
\\"skipLibCheck\\": true,
\\"strict\\": false,
\\"forceConsistentCasingInFileNames\\": true,
\\"noEmit\\": true,
\\"incremental\\": true,
\\"moduleResolution\\": \\"node\\",
......@@ -270,7 +266,6 @@ describe('tsconfig.json verifier', () => {
\\"allowJs\\": true,
\\"skipLibCheck\\": true,
\\"strict\\": false,
\\"forceConsistentCasingInFileNames\\": true,
\\"noEmit\\": true,
\\"incremental\\": true,
\\"moduleResolution\\": \\"node\\",
......@@ -326,7 +321,6 @@ describe('tsconfig.json verifier', () => {
\\"allowJs\\": true,
\\"skipLibCheck\\": true,
\\"strict\\": false,
\\"forceConsistentCasingInFileNames\\": true,
\\"noEmit\\": true,
\\"incremental\\": true,
\\"module\\": \\"esnext\\",
......@@ -382,7 +376,6 @@ describe('tsconfig.json verifier', () => {
\\"allowJs\\": true,
\\"skipLibCheck\\": true,
\\"strict\\": false,
\\"forceConsistentCasingInFileNames\\": true,
\\"noEmit\\": true,
\\"incremental\\": true,
\\"module\\": \\"esnext\\",
......@@ -434,7 +427,6 @@ describe('tsconfig.json verifier', () => {
\\"allowJs\\": true,
\\"skipLibCheck\\": true,
\\"strict\\": false,
\\"forceConsistentCasingInFileNames\\": true,
\\"noEmit\\": true,
\\"incremental\\": true,
\\"esModuleInterop\\": true,
......@@ -493,7 +485,6 @@ describe('tsconfig.json verifier', () => {
\\"allowJs\\": true,
\\"skipLibCheck\\": true,
\\"strict\\": false,
\\"forceConsistentCasingInFileNames\\": true,
\\"noEmit\\": true,
\\"incremental\\": true,
\\"resolveJsonModule\\": true,
......@@ -547,7 +538,6 @@ describe('tsconfig.json verifier', () => {
\\"allowJs\\": true,
\\"skipLibCheck\\": true,
\\"strict\\": false,
\\"forceConsistentCasingInFileNames\\": true,
\\"noEmit\\": true,
\\"incremental\\": true,
\\"esModuleInterop\\": true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment