Repository navigation
Fill out the TS Config reference #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1cd5942
f321163
313184d
8b2f0b5
e11d090
85873d5
d7ef582
919bfac
33da595
0651de7
17a5677
46277d8
2b87081
7d90577
572f72e
d65e30f
cb3e009
1f35a04
4c9fc01
409d4d0
b1f379a
413b02b
1de0e0c
fe84e45
31fca89
a2801ac
be7dcf6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| ### Testing | ||
|
|
||
| There are two types of tests: | ||
|
|
||
| - Units which are Jest tests, and not unique to this project | ||
|
|
||
| - Integration tests where you place a fixture code sample in the right folder and get a response JSON result. There are three folders for tests: | ||
| - `test/fixtures` - Any test in this file is shown in the README, so they should showcase features - not bugs | ||
| - `tests/fixtures/throws` - A test which should correctly raise | ||
| - `tests/fixtures/tests` - All other tests, repros etc |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,4 +5,4 @@ function fn(s) { | |
| console.log(s.subtr(3)) | ||
| } | ||
|
|
||
| fn(42); | ||
| fn(42) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| // Hello should not appear in the staticQuickInfos | ||
| const hello = "world" | ||
| const hello = 'world' | ||
| // ---cut--- | ||
| const bye = "globe" | ||
| const bye = 'globe' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| // @showEmit | ||
| // @removeComments: true | ||
| /** The translation of 'Hello world' into Portuguese */ | ||
| export declare const helloWorldPTBR = 'Olá Mundo' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "code": "", | ||
| "extension": "js", | ||
| "highlights": [], | ||
| "queries": [], | ||
| "staticQuickInfos": [], | ||
| "errors": [], | ||
| "playgroundURL": "https://www.typescriptlang.org/play/#code/Q" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,4 +2,4 @@ | |
| display: "Advanced" | ||
| --- | ||
|
|
||
| Additional Checks Copy | ||
| Flags which help with debugging | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| --- | ||
| display: "Basic Options" | ||
| display: "Project Options" | ||
| --- | ||
|
|
||
| Additional Checks Copy | ||
| These settings are used to define the runtime expectations of your project, how and where you want the JavaScript to be emitted and the level of integration you want with existing JavaScript code. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| --- | ||
| display: "Command Line" | ||
| --- | ||
|
|
||
| Additional Checks Copy |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| --- | ||
| display: "Project File Inclusion" | ||
| display: "File Inclusion" | ||
| --- | ||
|
|
||
|
|
||
| These settings help you ensure that TypeScript picks up the right files. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,4 +2,12 @@ | |
| display: "Strict Checks" | ||
| --- | ||
|
|
||
| Additional Checks Copy | ||
| TypeScript supports a spectrum of JavaScript patterns, TypeScript patterns and strives for backwards compatibility with them all. | ||
|
|
||
| Upgrading to a new version of TypeScript can uncover two types of errors: | ||
|
|
||
| - Errors which already exist in your codebase, TypeScript has uncovered because the language has become refined it's understanding of JavaScript. | ||
| - A new suite of errors which tackle a whole new problem domain. | ||
|
|
||
| TypeScript will usually add a compiler flag for the latter set of errors, and by default these are not enabled. | ||
| If you want to ensure that your codebase is as correct as possible, then use the option [`strict`](#strict) to opt-in to every possible improvement as they are built. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "improvement" seems like the wrong choice of words... |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,4 +2,21 @@ | |
| display: "Allow Synthetic Default Imports" | ||
| --- | ||
|
|
||
| Allow default imports from modules with no default export. This does not affect code emit, just typechecking. | ||
| When set to true, `allowSyntheticDefaultImports` let's you write an import like: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "let's" -> "lets us"? (Not a native speaker...) |
||
|
|
||
| ```ts | ||
| import React from "react" | ||
| ``` | ||
|
|
||
| instead of: | ||
|
|
||
| ```ts | ||
| import * as React from "react" | ||
| ``` | ||
|
|
||
| When the module **does not** specify a default export. | ||
|
|
||
| This does not affect the JavaScript emitted by TypeScript, it only for the type checking. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "it" -> "it's"? |
||
| This option brings the behavior of TypeScript in-line with Babel, where extra code is emitted to make using a default export of a module more ergonomic. | ||
|
|
||
|
|
||
|
orta marked this conversation as resolved.
|
||
Uh oh!
There was an error while loading. Please reload this page.