Skip to content

Commit edafc5f

Browse files
committed
docs: remove content from using-ts-effectively
This content is out of date (in the Mirage case) and duplicated (in the case of the duplicate types info). Remove it!
1 parent 4dcb2de commit edafc5f

File tree

1 file changed

+0
-65
lines changed

1 file changed

+0
-65
lines changed

docs/ts/using-ts-effectively.md

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -286,68 +286,3 @@ Some common stumbling blocks for people switching to ES6 classes from the tradit
286286
## Type definitions outside `node_modules/@types`
287287

288288
By default, the TypeScript compiler loads all type definitions found in `node_modules/@types`. If the type defs you need are not found there and are not supplied in the root of the package you're referencing, you can register a custom value in `paths` in the `tsconfig.json` file. See the [tsconfig.json docs](http://www.typescriptlang.org/docs/handbook/compiler-options.html#compiler-options) for details.
289-
290-
## ember-cli-mirage
291-
292-
Mirage adds files from a nonstandard location to your application tree, so you'll need to tell the TypeScript compiler about how that layout works.
293-
294-
For an app, this should look roughly like:
295-
296-
```javascript
297-
{
298-
"compilerOptions": {
299-
"paths": {
300-
// ...
301-
"my-app-name/mirage/*": "mirage/*",
302-
}
303-
},
304-
"include": [
305-
"app",
306-
"tests",
307-
"mirage"
308-
]
309-
}
310-
```
311-
312-
And for an addon:
313-
314-
```javascript
315-
{
316-
"compilerOptions": {
317-
"paths": {
318-
// ...
319-
"dummy/mirage/*": "tests/dummy/mirage/*",
320-
}
321-
},
322-
"include": [
323-
"addon",
324-
"tests"
325-
]
326-
}
327-
```
328-
329-
Note that if Mirage was present when you installed ember-cli-typescript (or if you run `ember g ember-cli-typescript`), this configuration should be automatically set up for you.
330-
331-
## "TypeScript is complaining about multiple copies of the same types!"
332-
333-
You may sometimes see TypeScript errors indicating that you have duplicate type definitions for Ember, Ember Data, etc. This is usually the result of an annoying quirk of the way both npm and yarn resolve your dependencies in their lockfiles.
334-
335-
### Just tell me how to fix it
336-
337-
There are two options here, neither of them _great_:
338-
339-
* manually edit `yarn.lock` or `package-lock.json` and merge the conflicting
340-
* add a ["resolutions"](https://yarnpkg.com/lang/en/docs/selective-version-resolutions/) key to your `package.json` with the version you want to install of the types you're installing:
341-
342-
```javascript
343-
{
344-
"resolutions": {
345-
"**/@types/ember": "2.8.15"
346-
}
347-
}
348-
```
349-
350-
### Why is this happening?
351-
352-
If you're using another package which includes these types, and then you trigger an upgrade for your own copy of the type definitions, npm and yarn will both try to preserve the existing installation and simply add a new one for your updated version. In most cases, this is sane behavior, because it prevents transitive dependency breakage hell. However, in the _specific_ case of type definitions, it causes TypeScript to get confused.
353-

0 commit comments

Comments
 (0)