Skip to content

Commit

Permalink
[docs] Fix the TS compiler options description (#3967)
Browse files Browse the repository at this point in the history
* Fix the TS compiler options description

* Remove info about JSON5
  • Loading branch information
VasilyStrelyaev committed Jul 2, 2019
1 parent 72a29fb commit c32ddb8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
18 changes: 10 additions & 8 deletions CHANGELOG.md
Expand Up @@ -6,18 +6,20 @@

#### :gear: Customize TypeScript Compiler Options ([#1845](https://github.com/DevExpress/testcafe/issues/1845))

TestCafe now allows you to specify the [TypeScript compiler options](https://www.typescriptlang.org/docs/handbook/compiler-options.html) in the `tsconfig.json` configuration file.
TestCafe now allows you to specify the [TypeScript compiler options](https://www.typescriptlang.org/docs/handbook/compiler-options.html) in the `tsconfig.json` configuration file. You can use these options to enable JSX compilation, import code or typings with `paths` aliases, set aliases to React typings, or customize other compiler settings.

You can use these options to enable JSX compilation, import code or typings with `paths` aliases, set aliases to React typings, or customize other compiler settings.
Define the `compilerOptions` property in `tsconfig.json` and specify the compiler options in this property:

```json
{
"jsx": "react",
"jsxFactory": "myFactory",
"paths": {
"jquery": [ "node_modules/jquery/dist/jquery" ]
},
"alwaysStrict": true
"compilerOptions": {
"jsx": "react",
"jsxFactory": "myFactory",
"paths": {
"jquery": [ "node_modules/jquery/dist/jquery" ]
},
"alwaysStrict": true
}
}
```

Expand Down
18 changes: 10 additions & 8 deletions docs/articles/blog/2019-7-2-testcafe-v1-3-0-released.md
Expand Up @@ -13,18 +13,20 @@ This release introduces support for the custom TypeScript configuration file and

### ⚙ Customize TypeScript Compiler Options ([#1845](https://github.com/DevExpress/testcafe/issues/1845))

TestCafe now allows you to specify the [TypeScript compiler options](https://www.typescriptlang.org/docs/handbook/compiler-options.html) in the `tsconfig.json` configuration file.
TestCafe now allows you to specify the [TypeScript compiler options](https://www.typescriptlang.org/docs/handbook/compiler-options.html) in the `tsconfig.json` configuration file. You can use these options to enable JSX compilation, import code or typings with `paths` aliases, set aliases to React typings, or customize other compiler settings.

You can use these options to enable JSX compilation, import code or typings with `paths` aliases, set aliases to React typings, or customize other compiler settings.
Define the `compilerOptions` property in `tsconfig.json` and specify the compiler options in this property:

```json
{
"jsx": "react",
"jsxFactory": "myFactory",
"paths": {
"jquery": [ "node_modules/jquery/dist/jquery" ]
},
"alwaysStrict": true
"compilerOptions": {
"jsx": "react",
"jsxFactory": "myFactory",
"paths": {
"jquery": [ "node_modules/jquery/dist/jquery" ]
},
"alwaysStrict": true
}
}
```

Expand Down
18 changes: 10 additions & 8 deletions docs/articles/documentation/test-api/typescript-support.md
Expand Up @@ -45,14 +45,18 @@ When you run a test Testcafe will output if there are any compilation errors.

TestCafe allows you to specify [TypeScript compiler options](https://www.typescriptlang.org/docs/handbook/compiler-options.html) in the `tsconfig.json` file. You can use these options to enable JSX compilation, import code or typings with `paths` aliases, set aliases to React typings, or customize other compiler settings.

Define the `compilerOptions` property in `tsconfig.json` and specify the compiler options in this property:

```json
{
"jsx": "react",
"jsxFactory": "myFactory",
"paths": {
"jquery": [ "node_modules/jquery/dist/jquery" ]
},
"alwaysStrict": true
"compilerOptions": {
"jsx": "react",
"jsxFactory": "myFactory",
"paths": {
"jquery": [ "node_modules/jquery/dist/jquery" ]
},
"alwaysStrict": true
}
}
```

Expand All @@ -62,8 +66,6 @@ See the available options in the [TypeScript Compiler Options](https://www.types
Save `tsconfig.json` to the directory from which you run TestCafe (usually the project's root directory), or specify the [tsConfigPath](../using-testcafe/configuration-file.md#tsconfigpath) option in the [configuration file](../using-testcafe/configuration-file.md) to use a different location.

> `tsconfig.json` supports [JSON5 syntax](https://json5.org/). This allows you to use JavaScript identifiers as object keys, single-quoted strings, comments and other JSON5 features.
TestCafe passes the following options to the TypeScript compiler unless you override them in `tsconfig.json`:

Option | Value
Expand Down

0 comments on commit c32ddb8

Please sign in to comment.