Skip to content

Commit 7999e10

Browse files
committed
Release 3.4.0
1 parent 2262d1e commit 7999e10

File tree

12 files changed

+42
-24
lines changed

12 files changed

+42
-24
lines changed

.github/ISSUE_TEMPLATE/formatting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you:
2626
2727
-->
2828

29-
**Prettier 3.3.3**
29+
**Prettier 3.4.0**
3030
[Playground link](https://prettier.io/playground/#.....)
3131

3232
```sh

.github/ISSUE_TEMPLATE/integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE:
2020

2121
**Environments:**
2222

23-
- Prettier Version: 3.3.3
23+
- Prettier Version: 3.4.0
2424
- Running Prettier via: <!-- CLI, Node.js API, Browser API, etc. -->
2525
- Runtime: <!-- Node.js v14, Chrome v83, etc. -->
2626
- Operating System: <!-- Windows, Linux, macOS, etc. -->

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 3.4.0
2+
3+
[diff](https://github.com/prettier/prettier/compare/3.3.3...3.4.0)
4+
5+
🔗 [Release Notes](https://prettier.io/blog/2024/11/26/3.4.0.html)
6+
17
# 3.3.3
28

39
[diff](https://github.com/prettier/prettier/compare/3.3.2...3.3.3)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "prettier",
3-
"version": "3.4.0-dev",
3+
"version": "3.4.0",
44
"description": "Prettier is an opinionated code formatter",
55
"bin": "./bin/prettier.cjs",
66
"repository": "prettier/prettier",

website/versioned_docs/version-stable/api.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ If `options.useCache` is `false`, all caching will be bypassed.
5050
```js
5151
const text = await fs.readFile(filePath, "utf8");
5252
const options = await prettier.resolveConfig(filePath);
53-
const formatted = await prettier.format(text, options);
53+
const formatted = await prettier.format(text, {
54+
...options,
55+
filepath: filePath,
56+
});
5457
```
5558

5659
If `options.editorconfig` is `true` and an [`.editorconfig` file](https://editorconfig.org/) is in your project, Prettier will parse it and convert its properties to the corresponding Prettier configuration. This configuration will be overridden by `.prettierrc`, etc. Currently, the following EditorConfig properties are supported:

website/versioned_docs/version-stable/browser.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Required options:
1919

2020
- **[`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.
2121

22-
- **`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 <https://unpkg.com/browse/prettier@3.3.3/plugins/>. Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON.
22+
- **`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 <https://unpkg.com/browse/prettier@3.4.0/plugins/>. Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON.
2323

2424
You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option.
2525

@@ -30,8 +30,8 @@ See below for examples.
3030
### Global
3131

3232
```html
33-
<script src="https://unpkg.com/prettier@3.3.3/standalone.js"></script>
34-
<script src="https://unpkg.com/prettier@3.3.3/plugins/graphql.js"></script>
33+
<script src="https://unpkg.com/prettier@3.4.0/standalone.js"></script>
34+
<script src="https://unpkg.com/prettier@3.4.0/plugins/graphql.js"></script>
3535
<script>
3636
(async () => {
3737
const formatted = await prettier.format("type Query { hello: String }", {
@@ -48,8 +48,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
4848

4949
```html
5050
<script type="module">
51-
import * as prettier from "https://unpkg.com/prettier@3.3.3/standalone.mjs";
52-
import prettierPluginGraphql from "https://unpkg.com/prettier@3.3.3/plugins/graphql.mjs";
51+
import * as prettier from "https://unpkg.com/prettier@3.4.0/standalone.mjs";
52+
import prettierPluginGraphql from "https://unpkg.com/prettier@3.4.0/plugins/graphql.mjs";
5353
5454
const formatted = await prettier.format("type Query { hello: String }", {
5555
parser: "graphql",
@@ -62,8 +62,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
6262

6363
```js
6464
define([
65-
"https://unpkg.com/prettier@3.3.3/standalone.js",
66-
"https://unpkg.com/prettier@3.3.3/plugins/graphql.js",
65+
"https://unpkg.com/prettier@3.4.0/standalone.js",
66+
"https://unpkg.com/prettier@3.4.0/plugins/graphql.js",
6767
], async (prettier, ...plugins) => {
6868
const formatted = await prettier.format("type Query { hello: String }", {
6969
parser: "graphql",
@@ -91,8 +91,8 @@ This syntax doesn’t necessarily work in the browser, but it can be used when b
9191
### Worker
9292

9393
```js
94-
importScripts("https://unpkg.com/prettier@3.3.3/standalone.js");
95-
importScripts("https://unpkg.com/prettier@3.3.3/plugins/graphql.js");
94+
importScripts("https://unpkg.com/prettier@3.4.0/standalone.js");
95+
importScripts("https://unpkg.com/prettier@3.4.0/plugins/graphql.js");
9696

9797
(async () => {
9898
const formatted = await prettier.format("type Query { hello: String }", {
@@ -108,9 +108,9 @@ If you want to format [embedded code](options.md#embedded-language-formatting),
108108

109109
```html
110110
<script type="module">
111-
import * as prettier from "https://unpkg.com/prettier@3.3.3/standalone.mjs";
112-
import prettierPluginBabel from "https://unpkg.com/prettier@3.3.3/plugins/babel.mjs";
113-
import prettierPluginEstree from "https://unpkg.com/prettier@3.3.3/plugins/estree.mjs";
111+
import * as prettier from "https://unpkg.com/prettier@3.4.0/standalone.mjs";
112+
import prettierPluginBabel from "https://unpkg.com/prettier@3.4.0/plugins/babel.mjs";
113+
import prettierPluginEstree from "https://unpkg.com/prettier@3.4.0/plugins/estree.mjs";
114114
115115
console.log(
116116
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
@@ -126,10 +126,10 @@ The HTML code embedded in JavaScript stays unformatted because the `html` parser
126126

127127
```html
128128
<script type="module">
129-
import * as prettier from "https://unpkg.com/prettier@3.3.3/standalone.mjs";
130-
import prettierPluginBabel from "https://unpkg.com/prettier@3.3.3/plugins/babel.mjs";
131-
import prettierPluginEstree from "https://unpkg.com/prettier@3.3.3/plugins/estree.mjs";
132-
import prettierPluginHtml from "https://unpkg.com/prettier@3.3.3/plugins/html.mjs";
129+
import * as prettier from "https://unpkg.com/prettier@3.4.0/standalone.mjs";
130+
import prettierPluginBabel from "https://unpkg.com/prettier@3.4.0/plugins/babel.mjs";
131+
import prettierPluginEstree from "https://unpkg.com/prettier@3.4.0/plugins/estree.mjs";
132+
import prettierPluginHtml from "https://unpkg.com/prettier@3.4.0/plugins/html.mjs";
133133
134134
console.log(
135135
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {

website/versioned_docs/version-stable/ignore.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ coverage
2525

2626
It’s recommended to have a `.prettierignore` in your project! This way you can run `prettier --write .` to make sure that everything is formatted (without mangling files you don’t want, or choking on generated files). And – your editor will know which files _not_ to format!
2727

28-
By default prettier ignores files in version control systems directories (".git", ".sl", ".svn" and ".hg") and `node_modules` (unless the [`--with-node-modules` CLI option](cli.md#--with-node-modules) is specified). Prettier will also follow rules specified in the ".gitignore" file if it exists in the same directory from which it is run.
28+
By default prettier ignores files in version control systems directories (".git", ".jj", ".sl", ".svn" and ".hg") and `node_modules` (unless the [`--with-node-modules` CLI option](cli.md#--with-node-modules) is specified). Prettier will also follow rules specified in the ".gitignore" file if it exists in the same directory from which it is run.
2929

3030
So by default it will be
3131

website/versioned_docs/version-stable/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Prettier is an opinionated code formatter with support for:
1212
- [Vue](https://vuejs.org/)
1313
- [Flow](https://flow.org/)
1414
- [TypeScript](https://www.typescriptlang.org/)
15-
- CSS, [Less](http://lesscss.org/), and [SCSS](https://sass-lang.com)
15+
- CSS, [Less](https://lesscss.org/), and [SCSS](https://sass-lang.com)
1616
- [HTML](https://en.wikipedia.org/wiki/HTML)
1717
- [Ember/Handlebars](https://handlebarsjs.com/)
1818
- [JSON](https://json.org/)

website/versioned_docs/version-stable/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ For example, you can do the following to have Prettier run before each commit:
143143
```bash
144144
yarn add --dev husky lint-staged
145145
npx husky init
146-
node --eval "fs.writeFileSync('.husky/pre-commit','npx lint-staged\n')"
146+
node --eval "fs.writeFileSync('.husky/pre-commit','yarn lint-staged\n')"
147147
```
148148

149149
> If you use Yarn 2, see https://typicode.github.io/husky/#/?id=yarn-2

website/versioned_docs/version-stable/options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ Valid options:
468468

469469
_First available in v2.6.0_
470470

471-
Enforce single attribute per line in HTML, Vue and JSX.
471+
Enforce single attribute per line in HTML, Vue, and JSX.
472472

473473
Valid options:
474474

0 commit comments

Comments
 (0)