Skip to content

Commit

Permalink
fix: corrected the error in config file name (#16154)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xflotus committed Mar 16, 2024
1 parent f62bf4a commit 6d2418f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ export class AppComponent {}

#### Use `"json"` parser for `tsconfig.json` by default ([#16012](https://github.com/prettier/prettier/pull/16012) by [@sosukesuzuki](https://github.com/sosukesuzuki))

In [v3.2.0](https://prettier.io/blog/2024/01/12/3.2.0#new-jsonc-parser-added-15831httpsgithubcomprettierprettierpull15831-by-fiskerhttpsgithubcomfisker), we introduced `"jsonc"` parser which adds trialing comma **by default**.
In [v3.2.0](https://prettier.io/blog/2024/01/12/3.2.0#new-jsonc-parser-added-15831httpsgithubcomprettierprettierpull15831-by-fiskerhttpsgithubcomfisker), we introduced `"jsonc"` parser which adds trailing comma **by default**.

When adding a new parser we also define how it will be used based on the [`linguist-languages`](https://www.npmjs.com/package/linguist-languages) data.

`tsconfig.json` is a special file used by [TypeScript](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#using-tsconfigjson-or-jsconfigjson), it uses `.json` file extension, but it actually uses the [JSON with Comments](https://code.visualstudio.com/docs/languages/json#_json-with-comments) syntax. However, we found that there are many third-party tools not recognize it correctly because of the confusing `.json` file extension.

We decide to treat it as a JSON file for now to avoid the extra configuration step.

To keep using the `"jsonc"` parser for your `tsconfig.json` files, add the following to your `.pretterrc` file
To keep using the `"jsonc"` parser for your `tsconfig.json` files, add the following to your `.prettierrc` file

```json
{
Expand Down

0 comments on commit 6d2418f

Please sign in to comment.