Title: Bad absolute paths in TS auto imports due to new baseUrl · Issue #5875 · angular/angular-cli · GitHub
Open Graph Title: Bad absolute paths in TS auto imports due to new baseUrl · Issue #5875 · angular/angular-cli
X Title: Bad absolute paths in TS auto imports due to new baseUrl · Issue #5875 · angular/angular-cli
Description: - [X] bug report Versions. cli 1.0.0 (since rc.2) typescript 2.2.2 (which is installed by default by the cli) Repro steps. typescript 2.2 introduced quickfixes for auto importing missing classes (in VS Code, a class not imported will be ...
Open Graph Description: - [X] bug report Versions. cli 1.0.0 (since rc.2) typescript 2.2.2 (which is installed by default by the cli) Repro steps. typescript 2.2 introduced quickfixes for auto importing missing classes (i...
X Description: - [X] bug report Versions. cli 1.0.0 (since rc.2) typescript 2.2.2 (which is installed by default by the cli) Repro steps. typescript 2.2 introduced quickfixes for auto importing missing classes (i...
Opengraph URL: https://github.com/angular/angular-cli/issues/5875
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bad absolute paths in TS auto imports due to new baseUrl","articleBody":"```\r\n- [X] bug report\r\n```\r\n\r\n### Versions.\r\ncli 1.0.0 (since rc.2)\r\ntypescript 2.2.2 (which is installed by default by the cli)\r\n\r\n### Repro steps.\r\ntypescript 2.2 introduced quickfixes for auto importing missing classes (in VS Code, a class not imported will be underlined in red, you can click on it, then on the bulb, and it would add the import).\r\n\r\nwith angular-cli rc.1, it would generate relative imports (the default behavior) : \r\n\r\n`import { SomeService } from './some.service';`\r\n\r\nsince angular-cli rc.2, as a `\"baseUrl\": \"src\"` has been introduced in the root tsconfig.json, the auto imports are now generated with absolute paths : \r\n\r\n`import { SomeService } from 'app/feature/some.service';`\r\n\r\nAnd, unless I'm wrong, it's bad practice (in particular for refactoring).\r\n\r\n@intellix says in #5353 `baseUrl` was introduced because : \r\n> When you're in VSC and write code like: import { environment } from 'environments/environment', it's flagged as being incorrect because the IDE doesn't know about tsconfig.app.json\r\n\r\nBut the CLI doesn't generate that, it generates this in `main.ts` : \r\n`import { environment } from './environments/environment';`\r\n\r\nwhich is the convention and which works perfectly fine, without `baseUrl`.\r\n\r\nSo except I'm missing something, this change should be reversed (I can do the PR if it's OK).","author":{"url":"https://github.com/cyrilletuzi","@type":"Person","name":"cyrilletuzi"},"datePublished":"2017-04-07T13:36:52Z","url":"https://github.com/angular/angular-cli/issues/5875"}
| 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:d97ede89-dd3d-01c0-3aac-5eb610058b7e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DF26:11EACE:33C6667:4521EF2:6B01F9AF |
| html-safe-nonce | 95673a95d1aa0c15a268585aed78f9ec59c49b9782113550d4f4b4f803368090 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjI2OjExRUFDRTozM0M2NjY3OjQ1MjFFRjI6NkIwMUY5QUYiLCJ2aXNpdG9yX2lkIjoiNDgzMjY3OTQ2MDc0NDU5MTc5MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f4c03ca1277cee9662b36a4cc1969ea22361b1db4eb1297ffa12422c97f449c8 |
| hovercard-subject-tag | issue:220216122 |
| 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/5875/issue_layout |
| twitter:image | https://opengraph.githubassets.com/981d01769259d16fe761ecbf80807536d8c265733d249b7287c4c4b5e5bd4bac/angular/angular-cli/issues/5875 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/981d01769259d16fe761ecbf80807536d8c265733d249b7287c4c4b5e5bd4bac/angular/angular-cli/issues/5875 |
| og:image:alt | - [X] bug report Versions. cli 1.0.0 (since rc.2) typescript 2.2.2 (which is installed by default by the cli) Repro steps. typescript 2.2 introduced quickfixes for auto importing missing classes (i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cyrilletuzi |
| 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 | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width