Skip to content

Commit e628a10

Browse files
authored
add ts 3.9RC
1 parent 06ef25c commit e628a10

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

docs/advanced/patterns.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,43 @@ handy for JSDoc users - `@public, @private, @protected, @readonly`
380380

381381
`assumeChangesOnlyAffectDirectDependencies` reduces build times for extremely large codebases.
382382

383+
384+
## TypeScript 3.9
385+
386+
[[Release Candidate](https://devblogs.microsoft.com/typescript/announcing-typescript-3-9-rc/)]
387+
388+
1. (minor feature) New `ts-expect-error` directive.
389+
390+
Use this when writing tests you expect to error.
391+
392+
```ts
393+
// @ts-expect-error
394+
console.log(47 * "octopus");
395+
```
396+
397+
Pick `ts-expect-error` if:
398+
399+
- you’re writing test code where you actually want the type system to error on an operation
400+
- you expect a fix to be coming in fairly quickly and you just need a quick workaround
401+
- you’re in a reasonably-sized project with a proactive team that wants to remove suppression comments as soon affected code is valid again
402+
403+
Pick `ts-ignore` if:
404+
405+
- you have an a larger project and and new errors have appeared in code with no clear owner
406+
- you are in the middle of an upgrade between two different versions of TypeScript, and a line of code errors in one version but not another.
407+
- you honestly don’t have the time to decide which of these options is better.
408+
409+
2. `}` and `>` are Now Invalid JSX Text Characters
410+
411+
They were always invalid, but now TypeScript and Babel are enforcing it:
412+
413+
```
414+
Unexpected token. Did you mean `{'>'}` or `>`?
415+
Unexpected token. Did you mean `{'}'}` or `}`?
416+
```
417+
418+
You can [convert these in bulk](https://github.com/microsoft/TypeScript/pull/37436) if needed.
419+
383420
## TypeScript Roadmap and Spec
384421

385422
https://github.com/Microsoft/TypeScript/wiki/Roadmap

0 commit comments

Comments
 (0)