Skip to content

Commit

Permalink
feat: add skipLibCheck and forceConsistentCasingInFileNames
Browse files Browse the repository at this point in the history
- as defaults to the templates' tsconfigs
  - these are now recommended by TS to be set to true, which can be
    seen in the TSConfig Reference and @tsconfig/recommended
    - c.f. https://www.typescriptlang.org/tsconfig and
      https://www.npmjs.com/package/@tsconfig/recommended
  - also add to all fixtures
    - yea some centralization/extends or dogfooding create would help
      reduce all this duplication

- skipLibCheck is a big perf gain, though it seems to only affect
  `tsc --noEmit` usage and rollup-plugin-typescript2 seems to ignore it
  - I have an existing issue open on the matter
- forceConsistentCasingInFileNames is a no-brainer to help avoid a bug
  that is easy to make and hard to debug

- also add a trailing comma for ease of use and better diffing
  - not to fixtures though, because there is a test for this
  • Loading branch information
agilgur5 committed Sep 17, 2020
1 parent 22a0b7b commit e0f79fe
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 9 deletions.
4 changes: 3 additions & 1 deletion templates/basic/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"jsx": "react",
"esModuleInterop": true
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
}
}
4 changes: 3 additions & 1 deletion templates/react-with-storybook/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"jsx": "react",
"esModuleInterop": true
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
}
}
4 changes: 3 additions & 1 deletion templates/react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"jsx": "react",
"esModuleInterop": true
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
}
}
4 changes: 3 additions & 1 deletion test/e2e/fixtures/build-default/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"jsx": "react",
"esModuleInterop": true
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src", "types"]
}
4 changes: 3 additions & 1 deletion test/e2e/fixtures/build-invalid/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"jsx": "react",
"esModuleInterop": true
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src", "types"]
}
4 changes: 3 additions & 1 deletion test/e2e/fixtures/build-withTsconfig/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"jsx": "react",
"esModuleInterop": false
"esModuleInterop": false,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src", "types"], // test parsing of trailing comma & comment
}
4 changes: 3 additions & 1 deletion test/integration/fixtures/build-options/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"jsx": "react",
"esModuleInterop": true
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src", "types"],
}
4 changes: 3 additions & 1 deletion test/integration/fixtures/build-withBabel/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"jsx": "react",
"esModuleInterop": true
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src", "types"],
}
4 changes: 3 additions & 1 deletion test/integration/fixtures/build-withConfig/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"jsx": "react",
"esModuleInterop": true
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src", "types"],
}

0 comments on commit e0f79fe

Please sign in to comment.