diff --git a/changelog_unreleased/api/pr-8983.md b/changelog_unreleased/api/pr-8983.md index c83cc44e3..4282ea7a0 100644 --- a/changelog_unreleased/api/pr-8983.md +++ b/changelog_unreleased/api/pr-8983.md @@ -1,6 +1,6 @@ #### [HIGHLIGHT]ESM standalone bundles ([#8983](https://github.com/prettier/prettier/pull/8983) by [@Monchi](https://github.com/Monchi), [@fisker](https://github.com/fisker)) -Now standalone is also bundled as ESM. It works directly on browser. +Prettier now also comes as ES modules, which can be directly used in modern browsers: ```js import prettier from "https://unpkg.com/prettier/esm/standalone.mjs"; diff --git a/changelog_unreleased/cli/pr-9298.md b/changelog_unreleased/cli/pr-9298.md index e3eb6e9a5..d402fa7d5 100644 --- a/changelog_unreleased/cli/pr-9298.md +++ b/changelog_unreleased/cli/pr-9298.md @@ -1,4 +1,4 @@ -#### Fix error on dir or file that name is a number (#9298 by @fisker) +#### Fix: error on directories and files with numeric names (#9298 by @fisker) ```console diff --git a/changelog_unreleased/css/pr-9209.md b/changelog_unreleased/css/pr-9209.md index 89da8951b..2a3f7f244 100644 --- a/changelog_unreleased/css/pr-9209.md +++ b/changelog_unreleased/css/pr-9209.md @@ -1,4 +1,4 @@ -#### Improve custom properties format (#9209 by @fisker) +#### Improve formatting for custom properties (#9209 by @fisker) Thanks to [`PostCSS 8.0`](https://github.com/postcss/postcss/releases/tag/8.0.0), we can handle these edge cases on custom properties. diff --git a/changelog_unreleased/flow/pr-9432.md b/changelog_unreleased/flow/pr-9432.md index 63ac02f42..a677ea504 100644 --- a/changelog_unreleased/flow/pr-9432.md +++ b/changelog_unreleased/flow/pr-9432.md @@ -1,4 +1,4 @@ -#### Flow Enums with unknown members (#9432 by @gkz) +#### Enums with unknown members (#9432 by @gkz) Previously, was not supported. Now, the following is formatted: diff --git a/changelog_unreleased/flow/pr-9457.md b/changelog_unreleased/flow/pr-9457.md index 285ee4423..7899e4fa5 100644 --- a/changelog_unreleased/flow/pr-9457.md +++ b/changelog_unreleased/flow/pr-9457.md @@ -1,6 +1,4 @@ -#### Flow `this` annotations (#9457 by @dsainati1, #9489 by @fisker) - -Add support for `this` parameter annotations in Flow. +#### `this` parameter annotations (#9457 by @dsainati1, #9489 by @fisker) ```jsx diff --git a/changelog_unreleased/flow/pr-9543.md b/changelog_unreleased/flow/pr-9543.md index bf298f64a..bc6582b49 100644 --- a/changelog_unreleased/flow/pr-9543.md +++ b/changelog_unreleased/flow/pr-9543.md @@ -1,4 +1,4 @@ -#### Treat more types as "simple" type (#9543 by @fisker) +#### Treat more simple types as non-breaking in generic type annotations (#9543 by @fisker) ```jsx diff --git a/changelog_unreleased/javascript/pr-9000.md b/changelog_unreleased/javascript/pr-9000.md index 32911f54e..789d55a96 100644 --- a/changelog_unreleased/javascript/pr-9000.md +++ b/changelog_unreleased/javascript/pr-9000.md @@ -1,5 +1,5 @@ #### [HIGHLIGHT]Add `espree` parser (#9000 by @fisker) -A new value for the `parser` option has been added: [`espree`](https://github.com/eslint/espree) - which is the [`ESLint`](https://github.com/eslint/eslint) default parser. +A new value for the `parser` option has been added: [`espree`](https://github.com/eslint/espree) - which is the default parser used by [`ESLint`](https://github.com/eslint/eslint). -Note that `espree` only works for [ECMAScript Finished Proposals](https://github.com/tc39/proposals/blob/master/finished-proposals.md), and is stricter than the `babel` parser. +Note that `espree` only works for [Finished ECMAScript Proposals](https://github.com/tc39/proposals/blob/master/finished-proposals.md), and is stricter than the `babel` parser. diff --git a/changelog_unreleased/javascript/pr-9278.md b/changelog_unreleased/javascript/pr-9278.md index 0efc1a6be..ede3ac621 100644 --- a/changelog_unreleased/javascript/pr-9278.md +++ b/changelog_unreleased/javascript/pr-9278.md @@ -1,4 +1,4 @@ -#### Fix comments inside template (#9278 by @fisker) +#### Fix comments inside template literals with embedded syntax (#9278 by @fisker) ```js diff --git a/changelog_unreleased/javascript/pr-9341.md b/changelog_unreleased/javascript/pr-9341.md index e7a38b91c..aeb46aeff 100644 --- a/changelog_unreleased/javascript/pr-9341.md +++ b/changelog_unreleased/javascript/pr-9341.md @@ -1,6 +1,6 @@ -#### Improve formatting for `AssignmentExpression` with `ClassExpression` that has a long super class (#9341 by @sosukesuzuki) +#### Improve formatting for assignments of classes with long superclass names (#9341 by @sosukesuzuki) -This improves the formatting for [Google Closure Library Namespace](https://developers.google.com/closure/library/docs/introduction#names). +This improves the formatting for [Google Closure Library namespaces](https://developers.google.com/closure/library/docs/introduction#names). ```js diff --git a/changelog_unreleased/javascript/pr-9345.md b/changelog_unreleased/javascript/pr-9345.md index d579dc6a7..57ac2fa5f 100644 --- a/changelog_unreleased/javascript/pr-9345.md +++ b/changelog_unreleased/javascript/pr-9345.md @@ -1,4 +1,4 @@ -#### Fix placing leading comments for a body of while statement (#9345 by @sosukesuzuki) +#### Fix placement of leading comments for bodies of `while` statements (#9345 by @sosukesuzuki) ```js diff --git a/changelog_unreleased/javascript/pr-9431.md b/changelog_unreleased/javascript/pr-9431.md index b3233bf01..0056c7ce6 100644 --- a/changelog_unreleased/javascript/pr-9431.md +++ b/changelog_unreleased/javascript/pr-9431.md @@ -1,4 +1,4 @@ -#### Keep html and markdown invalid template literals as it is (#9431 by @fisker) +#### Keep HTML and Markdown invalid template literals as is (#9431 by @fisker) ```js diff --git a/changelog_unreleased/javascript/pr-9435.md b/changelog_unreleased/javascript/pr-9435.md index b54aeeaa3..d856535a8 100644 --- a/changelog_unreleased/javascript/pr-9435.md +++ b/changelog_unreleased/javascript/pr-9435.md @@ -1,4 +1,4 @@ -#### Fix `import {a as a}` and `export {a as a}` format (#9435 by @fisker) +#### Fix formatting for `import {a as a}` and `export {a as a}` (#9435 by @fisker) ```js diff --git a/changelog_unreleased/markdown/pr-8786.md b/changelog_unreleased/markdown/pr-8786.md index 0523b5124..77af10af8 100644 --- a/changelog_unreleased/markdown/pr-8786.md +++ b/changelog_unreleased/markdown/pr-8786.md @@ -1,4 +1,4 @@ -#### Fix missing blank lines in fenced code block without end mark ([#8786](https://github.com/prettier/prettier/pull/8786) by [@fisker](https://github.com/fisker)) +#### Fix missing blank lines in fenced code blocks lacking the closing fence ([#8786](https://github.com/prettier/prettier/pull/8786) by [@fisker](https://github.com/fisker)) ```markdown diff --git a/changelog_unreleased/markdown/pr-9275.md b/changelog_unreleased/markdown/pr-9275.md index bd1105186..7f5664d10 100644 --- a/changelog_unreleased/markdown/pr-9275.md +++ b/changelog_unreleased/markdown/pr-9275.md @@ -1,4 +1,4 @@ -#### Add support for [[wiki-style]] links in markdown (#9275 by @iamrecursion) +#### Add support for `[[wiki-style]]` links (#9275 by @iamrecursion) 1. Support for `[[wiki-style]]` links ensures that they do not get broken by the prettier formatting by being wrapped over multiple lines. diff --git a/changelog_unreleased/mdx/pr-9267.md b/changelog_unreleased/mdx/pr-9267.md index 4997d105f..ee5743c27 100644 --- a/changelog_unreleased/mdx/pr-9267.md +++ b/changelog_unreleased/mdx/pr-9267.md @@ -1,4 +1,4 @@ -#### Fix JSX format (#9267 by @fisker) +#### Fix extra empty lines in JSX (#9267 by @fisker) ```markdown diff --git a/changelog_unreleased/typescript/pr-9318.md b/changelog_unreleased/typescript/pr-9318.md index 93d621294..3de4c1322 100644 --- a/changelog_unreleased/typescript/pr-9318.md +++ b/changelog_unreleased/typescript/pr-9318.md @@ -1,4 +1,4 @@ -#### Preserve a last separator for ignored object and interface types (#9318 by @sosukesuzuki) +#### Preserve the last separator in ignored object types and interfaces (#9318 by @sosukesuzuki) ```ts diff --git a/changelog_unreleased/typescript/pr-9484.md b/changelog_unreleased/typescript/pr-9484.md index 1c468a631..7b2634ce7 100644 --- a/changelog_unreleased/typescript/pr-9484.md +++ b/changelog_unreleased/typescript/pr-9484.md @@ -1,4 +1,4 @@ -#### Add parens to object value that it's an assignment (#9484 by @fisker) +#### Add parens around assignments in object literal properties (#9484 by @fisker) ```ts diff --git a/changelog_unreleased/typescript/pr-9521.md b/changelog_unreleased/typescript/pr-9521.md index 48ff062d2..9d63819f9 100644 --- a/changelog_unreleased/typescript/pr-9521.md +++ b/changelog_unreleased/typescript/pr-9521.md @@ -1,4 +1,4 @@ -#### Fix inconsistent type format between `typescript` and `flow` (#9521 by @fisker) +#### Fix inconsistencies in formatting of types between `typescript` and `flow` (#9521 by @fisker) ```ts diff --git a/changelog_unreleased/vue/pr-9225.md b/changelog_unreleased/vue/pr-9225.md index bd909dc28..480739ec9 100644 --- a/changelog_unreleased/vue/pr-9225.md +++ b/changelog_unreleased/vue/pr-9225.md @@ -1,4 +1,4 @@ -#### Fix inconsistent `v-for` format (#9225 by @zweimach) +#### Fix inconsistent formatting for `v-for` (#9225 by @zweimach) ```vue diff --git a/docs/browser.md b/docs/browser.md index 1766b6a44..96d81c1a6 100644 --- a/docs/browser.md +++ b/docs/browser.md @@ -3,13 +3,18 @@ id: browser title: Browser --- -Run Prettier in the browser with the `standalone.js` UMD bundle shipped in the NPM package (starting in version 1.13). The UMD bundle only formats the code and has no support for config files, ignore files, CLI usage, or automatic loading of plugins. +Run Prettier in the browser using its **standalone** version. This version only formats the code and has no support for config files, ignore files, CLI usage, or automatic loading of plugins. + +The standalone version comes as: + +- ES modules: `esm/standalone.mjs`, starting in version 2.2 +- UMD: `standalone.js`, starting in version 1.13 The [`browser` field](https://github.com/defunctzombie/package-browser-field-spec) in Prettier’s `package.json` points to `standalone.js`. That’s why you can just `import` or `require` the `prettier` module to access Prettier’s API, and your code can stay compatible with both Node and the browser as long as webpack or another bundler that supports the `browser` field is used. This is especially convenient for [plugins](plugins.md). ### `prettier.format(code, options)` -Unlike the `format` function from the [main API](api.md#prettierformatsource--options), this function does not load plugins automatically, so a `plugins` property is required if you want to load plugins. Additionally, the parsers included in the Prettier package won’t be loaded automatically, so you need to load them before using them. +Unlike the `format` function from the [main API](api.md#prettierformatsource--options), this function does not load plugins automatically, so a `plugins` property is required if you want to load plugins. Additionally, the parsers included in the Prettier package won’t be loaded automatically, so you need to load them as plugins before using them. See [Usage](#usage) below for examples.