Title: Configuration Inheritance · Issue #9876 · microsoft/TypeScript · GitHub
Open Graph Title: Configuration Inheritance · Issue #9876 · microsoft/TypeScript
X Title: Configuration Inheritance · Issue #9876 · microsoft/TypeScript
Description: Our friends from Angular (@angular) asked for this feature while they were visiting last week, since they use a lot of configuration files internally. Proposal Add a new top-level (alongside compilerOptions, files, includes, and excludes...
Open Graph Description: Our friends from Angular (@angular) asked for this feature while they were visiting last week, since they use a lot of configuration files internally. Proposal Add a new top-level (alongside compil...
X Description: Our friends from Angular (@angular) asked for this feature while they were visiting last week, since they use a lot of configuration files internally. Proposal Add a new top-level (alongside compil...
Mail addresses
notifications@github.com
Opengraph URL: https://github.com/microsoft/TypeScript/issues/9876
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Configuration Inheritance","articleBody":"Our friends from @angular asked for this feature while they were visiting last week, since they use a lot of configuration files internally.\n# Proposal\n\nAdd a new top-level (alongside compilerOptions, files, includes, and excludes) `tsconfig` parameter - `extends` (to steal the term from [`eslint`](http://eslint.org/docs/developer-guide/shareable-configs)).\n- Its value is a string or an array of strings which are interpreted as rooted or relative paths (so starting with either a drive root or `.` or `..`) from the current tsconfig to other tsconfigs to inherit from - with or without a `.json` extension, if no extension is provided, we first look for an extensionless file by the name, and failing that, add a .json extension and look for that. \n- If we add recommended or built-in configs to inherit from in the future, those will look like a module identifier, rather than a path (ie, `\"typescript/strict\"`). For now, non-relative, non-rooted paths will be an error. At present, built-in or shareable configs are not part of this proposal.\n- All configs your config inherits from are first parsed and resolved (thereby filling in anything they inherit), and then merged. Configs later in the list override the configuration provided by those earlier in the list. Configuration in the active config can override those provided by an inheriting config. If a circularity is encountered, we report an error.\n- If any inherited configs we load have errors, we will report them.\n- Top-level members other than `compilerOptions` are completely overridden by following definitions. `compilerOptions` at the top level is merged (though its individual keys will still be overridden as though they were top-level keys).\n- Relative paths found in the configuration file will be resolved relative to the configuration file they originated in.\n# Examples\n\n`configs/base.json`:\n\n``` ts\n{\n \"compilerOptions\": {\n \"allowJs\": true,\n \"noImplicitAny\": true,\n \"strictNullChecks\": true\n }\n}\n```\n\n`configs/tests.json`:\n\n``` ts\n{\n \"compilerOptions\": {\n \"preserveConstEnums\": true,\n \"stripComments\": false,\n \"sourceMaps\": true\n },\n \"exclude\": [\n \"../tests/baselines\",\n \"../tests/scenarios\"\n ],\n \"include\": [\n \"../tests/**/*.ts\"\n ]\n}\n```\n\n`tsconfig.json`:\n\n``` ts\n{\n \"extends\": \"./configs/base\",\n \"files\": [\n \"main.ts\",\n \"supplemental.ts\"\n ]\n}\n```\n\n`tsconfig.nostrictnull.json`:\n\n``` ts\n{\n \"extends\": \"./tsconfig\"\n \"compilerOptions\": {\n \"strictNullChecks\": false\n }\n}\n```\n\n`tsconfig.tests.json`:\n\n``` ts\n{\n \"extends\": [\"./configs/tests\", \"./tsconfig\"],\n \"compilerOptions\": {\n \"module\": \"commonjs\"\n }\n}\n```\n\n`tsconfig.tests.browser.json`:\n\n``` ts\n{\n \"extends\": [\"./configs/tests\", \"./tsconfig\"],\n \"compilerOptions\": {\n \"module\": \"amd\"\n }\n}\n```\n\n@alexeagle @DanielRosenwasser Does this cover your usecases?\n","author":{"url":"https://github.com/weswigham","@type":"Person","name":"weswigham"},"datePublished":"2016-07-21T20:31:10Z","url":"https://github.com/microsoft/TypeScript/issues/9876"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6013eb29-01a7-80a1-cde7-973b0e1fa065 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A3AE:34CAB:3BA72B:4D7CEE:6B00D441 |
| html-safe-nonce | 9b8ef5fe60d6a781f7c708f3768618367c9944a31aca361cc508fdba1e00e5f7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0FFOjM0Q0FCOjNCQTcyQjo0RDdDRUU6NkIwMEQ0NDEiLCJ2aXNpdG9yX2lkIjoiNjU2MTYzNzA4NzEyMzEzMzUwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | cd1b3c6be72d4c4e6184f684229ec6be2cd2087723267a6de8f8cda6ecdb7204 |
| hovercard-subject-tag | issue:166910751 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/9876/issue_layout |
| twitter:image | https://opengraph.githubassets.com/58a23ccfc705b60d1498889c49e4cdc84d22226e4fbed1bc5d57c1883b66236b/microsoft/TypeScript/issues/9876 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/58a23ccfc705b60d1498889c49e4cdc84d22226e4fbed1bc5d57c1883b66236b/microsoft/TypeScript/issues/9876 |
| og:image:alt | Our friends from Angular (@angular) asked for this feature while they were visiting last week, since they use a lot of configuration files internally. Proposal Add a new top-level (alongside compil... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | weswigham |
| hostname | github.com |
| expected-hostname | github.com |
| None | 85bbdfe2b6ba16e234513bc6ceff5d848ef8449820c900692a2b4e67061931e5 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4943239a6d2c591325dad6e5c313e1cafda877f6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width