diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index e211da2bfd44..8768fe945144 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -5,6 +5,8 @@ # See https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt # Prettier bump after release +# 3.2.3 +4985be553e911fef7d83f3341eb143c443473c58 # 3.2.2 afc0a6b5fae11c86c18bbc345775821607d4d41d # 3.2.1 diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index e43296162df8..641de3d6ecf3 100644 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ b/.github/ISSUE_TEMPLATE/formatting.md @@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you: --> -**Prettier 3.2.3** +**Prettier 3.2.4** [Playground link](https://prettier.io/playground/#.....) ```sh diff --git a/.github/ISSUE_TEMPLATE/integration.md b/.github/ISSUE_TEMPLATE/integration.md index 67991a89cf55..2c993198ed5c 100644 --- a/.github/ISSUE_TEMPLATE/integration.md +++ b/.github/ISSUE_TEMPLATE/integration.md @@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE: **Environments:** -- Prettier Version: 3.2.3 +- Prettier Version: 3.2.4 - Running Prettier via: - Runtime: - Operating System: diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c3c1f0d64d0..93f65a3adae1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +# 3.2.4 + +[diff](https://github.com/prettier/prettier/compare/3.2.3...3.2.4) + +#### Fix incorrect parser inference ([#15947](https://github.com/prettier/prettier/pull/15947) by [@fisker](https://github.com/fisker)) + +Files like `.eslintrc.json` were incorrectly formatted as JSONC files. + + +```jsx +// Input +prettier --file-info .eslintrc.json +{ "ignored": false, "inferredParser": "jsonc" } + +// Prettier 3.2.4 +prettier --file-info .eslintrc.json +{ "ignored": false, "inferredParser": "json" } +``` + # 3.2.3 [diff](https://github.com/prettier/prettier/compare/3.2.2...3.2.3) diff --git a/changelog_unreleased/api/15927.md b/changelog_unreleased/api/15927.md deleted file mode 100644 index 36a468c81a28..000000000000 --- a/changelog_unreleased/api/15927.md +++ /dev/null @@ -1,12 +0,0 @@ -#### Fix parser inference (#15927 by @fisker) - - -```console -// Prettier stable -prettier --file-info tsconfig.json -{ "ignored": false, "inferredParser": "json" } - -// Prettier main -prettier --file-info tsconfig.json -{ "ignored": false, "inferredParser": "jsonc" } -``` diff --git a/changelog_unreleased/json/15947.md b/changelog_unreleased/json/15947.md new file mode 100644 index 000000000000..59d9c68cbbbf --- /dev/null +++ b/changelog_unreleased/json/15947.md @@ -0,0 +1,14 @@ +#### Fix incorrect parser inference (#15947 by @fisker) + +Files like `.eslintrc.json` were incorrectly formatted as JSONC files. + + +```jsx +// Input +prettier --file-info .eslintrc.json +{ "ignored": false, "inferredParser": "jsonc" } + +// Prettier main +prettier --file-info .eslintrc.json +{ "ignored": false, "inferredParser": "json" } +``` diff --git a/changelog_unreleased/typescript/15881.md b/changelog_unreleased/typescript/15881.md deleted file mode 100644 index ad68ab7619cf..000000000000 --- a/changelog_unreleased/typescript/15881.md +++ /dev/null @@ -1,30 +0,0 @@ -#### Throw errors for invalid code (#15881 by @fisker, @Josh-Cena, @auvred) - - -```ts -// Input -1++; - -// Prettier stable -1++; - -// Prettier main -SyntaxError: Invalid left-hand side expression in unary operation (1:1) -> 1 | 1++; - | ^ -``` - - -```ts -// Input -try {} catch (error = 1){} - -// Prettier stable -try { -} catch (error) {} - -// Prettier main -SyntaxError: Catch clause variable cannot have an initializer. (1:23) -> 1 | try {} catch (error = 1){} - | ^ -``` diff --git a/cspell.json b/cspell.json index 9b1bcc420f20..0de2c90adfa5 100644 --- a/cspell.json +++ b/cspell.json @@ -156,6 +156,7 @@ "jscodeshift", "jsesc", "jsfmt", + "jslintrc", "jsonata", "judgements", "kalmanb", @@ -284,6 +285,7 @@ "softlines", "Sorin", "Sosuke", + "sosukesuzuki", "Spampinato", "speculationrules", "srcset", diff --git a/docs/browser.md b/docs/browser.md index 1a02c9cdb0ce..ae0c487ab709 100644 --- a/docs/browser.md +++ b/docs/browser.md @@ -18,7 +18,7 @@ Required options: - **[`parser`](options.md#parser) (or [`filepath`](options.md#file-path))**: One of these options has to be specified for Prettier to know which parser to use. -- **`plugins`**: Unlike the `format` function from the [Node.js-based API](api.md#prettierformatsource--options), this function doesn’t load plugins automatically. The `plugins` option is required because all the parsers included in the Prettier package come as plugins (for reasons of file size). These plugins are files in . Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON. +- **`plugins`**: Unlike the `format` function from the [Node.js-based API](api.md#prettierformatsource--options), this function doesn’t load plugins automatically. The `plugins` option is required because all the parsers included in the Prettier package come as plugins (for reasons of file size). These plugins are files in . Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON. You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option. @@ -29,8 +29,8 @@ See below for examples. ### Global ```html - - + + - + +