Skip to content

Commit

Permalink
♻️ Use a shared tsconfig.base.json (#37215)
Browse files Browse the repository at this point in the history
* Use a shared tsconfig.base.json

* Reverse tsconfig dependencies,

* Update eslint import resolver

* Add third_party in root

* Let wg-performance own tsconfig base

* Lint fix and remove extra extends

* Base can only contain passing paths

* Lint fixes
  • Loading branch information
rcebulko authored Dec 14, 2021
1 parent 4aac829 commit 92d03d4
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 22 deletions.
2 changes: 1 addition & 1 deletion OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
{
// Locked down to minimize new import aliases being added
pattern: 'tsconfig.json',
pattern: 'tsconfig{,.base}.json',
owners: [{name: 'ampproject/wg-performance', required: true}],
},
],
Expand Down
20 changes: 3 additions & 17 deletions src/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
{
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"noEmit": true,
"downlevelIteration": true,
"target": "esnext",
"moduleResolution": "node",
"strictNullChecks": true,
"noImplicitAny": true,
"lib": ["dom", "esnext", "es6"],
"paths": {
"#core": ["."],
"#core/*": ["./*"]
}
},
"include": ["**/*.js", "**/*.d.ts"],
"exclude": ["**/*.extern.js"]
"compilerOptions": {"baseUrl": "../.."},
"extends": "../../tsconfig.base.json",
"include": ["**/*.js", "**/*.d.ts"]
}
28 changes: 28 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"noEmit": true,
"downlevelIteration": true,
"target": "esnext",
"moduleResolution": "node",
"strictNullChecks": true,
"noImplicitAny": true,
"lib": ["dom", "esnext", "es6"],

"paths": {
"#compiler": ["./src/compiler"],
"#compiler/*": ["./src/compiler/*"],
"#core/*": ["./src/core/*"]
}
},

"exclude": [
"**/build/**",
"**/dist/**",
"**/dist.*/**",
"**/node_modules/**",
"**/third_party/**",
"**/*.extern.js"
]
}
9 changes: 5 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"extends": "./tsconfig.base.json",

"compilerOptions": {
"allowJs": true,
"baseUrl": ".",
"outDir": "dist",
"noEmit": true,

"paths": {
"#3p/*": ["./3p/*"],
"#ads/*": ["./ads/*"],
Expand Down Expand Up @@ -33,6 +34,6 @@
"#third_party/*": ["./third_party/*"]
}
},
"include": ["src", "3p", "ads", "extensions", "test", "testing"],
"exclude": ["**/build/**", "**/dist/**", "**/dist.*/**", "**/node_modules/**"]

"include": ["src", "3p", "ads", "extensions", "test", "testing"]
}

0 comments on commit 92d03d4

Please sign in to comment.