Skip to content

Clarify allowed syntax in tsconfig.json #3386

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

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions packages/documentation/copy/en/project-config/tsconfig.json.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,30 @@ The `"compilerOptions"` property can be omitted, in which case the compiler's de

To learn more about the hundreds of configuration options in the [TSConfig Reference](/tsconfig).

## File format

`tsconfig.json` files are interpreted as JSON with some exceptions:

* Both single line `//` and multiline `/* ... */` comments are allowed.
* Trailing commas are allowed as well.

```json tsconfig
{
/**
* This is a valid tsconfig.json
*/
"extends": "@tsconfig/node12/tsconfig.json",

"compilerOptions": {
"preserveConstEnums": true, // Do not erase const enum declarations in generated code.
},

"include": ["src/**/*"],
"exclude": ["**/*.spec.ts"],
}
```


## Schema

The `tsconfig.json` Schema can be found at [the JSON Schema Store](http://json.schemastore.org/tsconfig).