{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9876","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9876/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9876/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9876/events","html_url":"https://github.com/Microsoft/TypeScript/issues/9876","id":166910751,"number":9876,"title":"Configuration Inheritance","user":{"login":"weswigham","id":2932786,"avatar_url":"https://avatars.githubusercontent.com/u/2932786?v=3","gravatar_id":"","url":"https://api.github.com/users/weswigham","html_url":"https://github.com/weswigham","followers_url":"https://api.github.com/users/weswigham/followers","following_url":"https://api.github.com/users/weswigham/following{/other_user}","gists_url":"https://api.github.com/users/weswigham/gists{/gist_id}","starred_url":"https://api.github.com/users/weswigham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weswigham/subscriptions","organizations_url":"https://api.github.com/users/weswigham/orgs","repos_url":"https://api.github.com/users/weswigham/repos","events_url":"https://api.github.com/users/weswigham/events{/privacy}","received_events_url":"https://api.github.com/users/weswigham/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/In%20Discussion","name":"In Discussion","color":"556b75"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Suggestion","name":"Suggestion","color":"006b75"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":22,"created_at":"2016-07-21T20:31:10Z","updated_at":"2016-07-26T01:18:45Z","closed_at":null,"body":"Our friends from @angular asked for this feature while they were visiting last week, since they use a lot of configuration files internally.\r\n\r\nProposal\r\n======\r\n\r\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)).\r\n\r\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. \r\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.\r\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.\r\n- If any inherited configs we load have errors, we will report them.\r\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).\r\n- Relative paths found in the configuration file will be resolved relative to the configuration file they originated in.\r\n\r\nExamples\r\n======\r\n\r\n`configs/base.json`:\r\n```ts\r\n{\r\n  \"compilerOptions\": {\r\n    \"allowJs\": true,\r\n    \"noImplicitAny\": true,\r\n    \"strictNullChecks\": true\r\n  }\r\n}\r\n```\r\n\r\n`configs/tests.json`:\r\n```ts\r\n{\r\n  \"compilerOptions\": {\r\n    \"preserveConstEnums\": true,\r\n    \"stripComments\": false,\r\n    \"sourceMaps\": true\r\n  },\r\n  \"excludes\": [\r\n    \"../tests/baselines\",\r\n    \"../tests/scenarios\"\r\n  ],\r\n  \"includes\": [\r\n    \"../tests/**/*.ts\"\r\n  ]\r\n}\r\n```\r\n\r\n`tsconfig.json`:\r\n```ts\r\n{\r\n  \"extends\": \"./configs/base\",\r\n  \"files\": [\r\n    \"main.ts\",\r\n    \"supplemental.ts\"\r\n  ]\r\n}\r\n```\r\n\r\n`tsconfig.nostrictnull.json`:\r\n```ts\r\n{\r\n  \"extends\": \"./tsconfig\"\r\n  \"compilerOptions\": {\r\n    \"strictNullChecks\": false\r\n  }\r\n}\r\n```\r\n\r\n`tsconfig.tests.json`:\r\n```ts\r\n{\r\n  \"extends\": [\"./configs/tests\", \"./tsconfig\"],\r\n  \"compilerOptions\": {\r\n    \"module\": \"commonjs\"\r\n  }\r\n}\r\n```\r\n\r\n`tsconfig.tests.browser.json`:\r\n```ts\r\n{\r\n  \"extends\": [\"./configs/tests\", \"./tsconfig\"],\r\n  \"compilerOptions\": {\r\n    \"module\": \"amd\"\r\n  }\r\n}\r\n```\r\n\r\n@alexeagle @DanielRosenwasser Does this cover your usecases?"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/235135073","html_url":"https://github.com/Microsoft/TypeScript/issues/9876#issuecomment-235135073","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9876","id":235135073,"user":{"login":"weswigham","id":2932786,"avatar_url":"https://avatars.githubusercontent.com/u/2932786?v=3","gravatar_id":"","url":"https://api.github.com/users/weswigham","html_url":"https://github.com/weswigham","followers_url":"https://api.github.com/users/weswigham/followers","following_url":"https://api.github.com/users/weswigham/following{/other_user}","gists_url":"https://api.github.com/users/weswigham/gists{/gist_id}","starred_url":"https://api.github.com/users/weswigham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weswigham/subscriptions","organizations_url":"https://api.github.com/users/weswigham/orgs","repos_url":"https://api.github.com/users/weswigham/repos","events_url":"https://api.github.com/users/weswigham/events{/privacy}","received_events_url":"https://api.github.com/users/weswigham/received_events","type":"User","site_admin":false},"created_at":"2016-07-26T01:18:45Z","updated_at":"2016-07-26T01:18:45Z","body":"I've opened #9941 with an implementation of the proposal thus far - it didn't seem like there was any contention over anything other than path handling. That question was resolved, so it seemed as though consensus had been reached, at least for now."}}
{"actor":{"display_login":"weswigham"}}