Title: Improve absolute import parsing for editors by moving baseUrl · Issue #7964 · angular/angular-cli · GitHub
Open Graph Title: Improve absolute import parsing for editors by moving baseUrl · Issue #7964 · angular/angular-cli
X Title: Improve absolute import parsing for editors by moving baseUrl · Issue #7964 · angular/angular-cli
Description: Bug Report or Feature Request (mark with an x) - [] bug report -> please search issues before submitting - [x] feature request Versions. @angular/cli: 1.4.4 node: 6.11.3 os: linux x64 @angular/animations: 4.4.4 @angular/common: 4.4.4 @an...
Open Graph Description: Bug Report or Feature Request (mark with an x) - [] bug report -> please search issues before submitting - [x] feature request Versions. @angular/cli: 1.4.4 node: 6.11.3 os: linux x64 @angular/anim...
X Description: Bug Report or Feature Request (mark with an x) - [] bug report -> please search issues before submitting - [x] feature request Versions. @angular/cli: 1.4.4 node: 6.11.3 os: linux x64 @angular/a...
Opengraph URL: https://github.com/angular/angular-cli/issues/7964
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve absolute import parsing for editors by moving baseUrl","articleBody":"\u003c!--\r\nIF YOU DON'T FILL OUT THE FOLLOWING INFORMATION YOUR ISSUE MIGHT BE CLOSED WITHOUT INVESTIGATING\r\n-->\r\n### Bug Report or Feature Request (mark with an `x`)\r\n```\r\n- [] bug report -> please search issues before submitting\r\n- [x] feature request\r\n```\r\n\r\n### Versions.\r\n\u003c!--\r\nOutput from: `ng --version`.\r\nIf nothing, output from: `node --version` and `npm --version`.\r\n Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)\r\n-->\r\n@angular/cli: 1.4.4\r\nnode: 6.11.3\r\nos: linux x64\r\n@angular/animations: 4.4.4\r\n@angular/common: 4.4.4\r\n@angular/compiler: 4.4.4\r\n@angular/core: 4.4.4\r\n@angular/forms: 4.4.4\r\n@angular/http: 4.4.4\r\n@angular/platform-browser: 4.4.4\r\n@angular/platform-browser-dynamic: 4.4.4\r\n@angular/router: 4.4.4\r\n@angular/cli: 1.4.4\r\n@angular/compiler-cli: 4.4.4\r\n@angular/language-service: 4.4.4\r\ntypescript: 2.3.4\r\n\r\n### Repro steps.\r\n\u003c!--\r\nSimple steps to reproduce this bug.\r\nPlease include: commands run, packages added, related code changes.\r\nA link to a sample repo would help too.\r\n-->\r\nThis improvements refers mainly to [vscode/#24362](https://github.com/Microsoft/vscode/issues/24362) but i think it will be reproduced by other editors in the future as well. Currently the main (and only) typescript config file parsed by editors is `tsconfig.json`. Since the files `./src/tsconfig.app.json` and `./src/tsconfig.spec.json` both contains`\"baseUrl\": \"./\"` but there is no `baseUrl` property in `./tsconfig.json` which they both extend there is no way for the common editor to know what the main `baseUrl` is and it will struggle with resolving and refactoring absolute imports (although compiling with `ng build` works fine).\r\n\r\n### The log given by the failure.\r\n\u003c!-- Normally this include a stack trace and some more information. -->\r\nFor example just \"out of the box\" app after `ng new` and changing one relative import to absolute one produces :\r\n\r\n\r\n\r\n\r\n\r\n### Desired functionality.\r\n\u003c!--\r\nWhat would like to see implemented?\r\nWhat is the usecase?\r\n-->\r\nif (as I wrote [here](https://github.com/Microsoft/vscode/issues/24362#issuecomment-334934143)) the `baseUrl` property will be moved from `./src/tsconfig.app.json` and `./src/tsconfig.spec .json` files to `./tsconfig.json` and it will hold there `\"baseUrl\": \"./src/\"` it will solve the issue and will create better parsing for other editors in the future.\r\n\r\n### Mention any other details that might be useful.\r\n\u003c!-- Please include a link to the repo if this is related to an OSS project. -->\r\n\r\n1. [vscode/24362](https://github.com/Microsoft/vscode/issues/24362)\r\n2. [vscode/12463](https://github.com/Microsoft/vscode/issues/12463)","author":{"url":"https://github.com/nitzano","@type":"Person","name":"nitzano"},"datePublished":"2017-10-07T14:12:10Z","url":"https://github.com/angular/angular-cli/issues/7964"}
| 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:719434c9-5cf8-01ef-fc41-9fc9ffc70433 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A58A:3CBB3E:2E17B12:3ADC9E0:6B02023A |
| html-safe-nonce | 83fef99b9691df27248f8b99203cf29b56b4fd6f5ba2318d90ac245d53cfee13 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNThBOjNDQkIzRToyRTE3QjEyOjNBREM5RTA6NkIwMjAyM0EiLCJ2aXNpdG9yX2lkIjoiMTAyMzEzOTkxMTY2MTAwMDI2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | eaf57f0cfec42c44e8456f05f0d3edd17533af6d8f08e7cc63362a44e09066c8 |
| hovercard-subject-tag | issue:263644135 |
| 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/angular/angular-cli/7964/issue_layout |
| twitter:image | https://opengraph.githubassets.com/86c35a586869c954c4b0a1d682635b6ddd38a7787fecfdefacd1a8c3c490f11a/angular/angular-cli/issues/7964 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/86c35a586869c954c4b0a1d682635b6ddd38a7787fecfdefacd1a8c3c490f11a/angular/angular-cli/issues/7964 |
| og:image:alt | Bug Report or Feature Request (mark with an x) - [] bug report -> please search issues before submitting - [x] feature request Versions. @angular/cli: 1.4.4 node: 6.11.3 os: linux x64 @angular/anim... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nitzano |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width