Skip to content

Commit

Permalink
Refactor tsconfigs to share compiler options
Browse files Browse the repository at this point in the history
This lets each config specify *only* how it actually does a build (or
not!), while sharing the config explicitly.
  • Loading branch information
chriskrycho committed Oct 26, 2022
1 parent b2deb48 commit 2580235
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 40 deletions.
34 changes: 34 additions & 0 deletions tsconfig.compiler-options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"compilerOptions": {
// Compilation Configuration
"target": "es2019",
"sourceMap": true,
"baseUrl": "packages",
"rootDir": "packages",

// Environment Configuration
"experimentalDecorators": true,
"moduleResolution": "node",

// Enhance Strictness
"strict": true,
"noImplicitReturns": true,
"allowUnreachableCode": false,
"noPropertyAccessFromIndexSignature": true,
"noUnusedLocals": true,
"noUncheckedIndexedAccess": true,
"noUnusedParameters": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": false,

"newLine": "LF",

"allowJs": true,
"checkJs": false,
"paths": {
"backburner": [
"../node_modules/backburner.js/dist/backburner.d.ts"
]
}
}
}
33 changes: 1 addition & 32 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,8 @@
{
"extends": "./tsconfig.compiler-options.json",
"compilerOptions": {
// Compilation Configuration
"target": "es2019",
"sourceMap": true,
"outDir": "dist",
"baseUrl": "packages",
"rootDir": "packages",

// Environment Configuration
"experimentalDecorators": true,
"moduleResolution": "node",

// Enhance Strictness
"strict": true,
"noImplicitReturns": true,
"allowUnreachableCode": false,
"noPropertyAccessFromIndexSignature": true,
"noUnusedLocals": true,
"noUncheckedIndexedAccess": true,
"noUnusedParameters": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": false,

"newLine": "LF",
"noEmit": true,

"allowJs": true,
"checkJs": false,

"paths": {
"backburner": ["../node_modules/backburner.js/dist/backburner.d.ts"]
}
},

"include": ["packages/**/*.ts"],

"exclude": ["dist", "node_modules", "tmp", "types"]
}
10 changes: 2 additions & 8 deletions tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./tsconfig.json",
"extends": "./tsconfig.compiler-options.json",
"compilerOptions": {
"noEmit": false,
"declaration": true,
Expand All @@ -17,12 +17,6 @@
"packages/@glimmer/**/*"
],
"exclude": [
"dist",
"node_modules",
"tmp",
"types",
"packages/ember-template-compiler",
"packages/ember-testing",
"packages/internal-test-helpers"
"**/type-tests"
]
}

0 comments on commit 2580235

Please sign in to comment.