From 3c56b9ad184aa2b02e0c8f238d52b5be0f68e61c Mon Sep 17 00:00:00 2001 From: Ika Date: Wed, 30 Jan 2019 16:23:45 +0800 Subject: [PATCH] Release 1.16.2 --- .github/ISSUE_TEMPLATE/formatting.md | 2 +- .github/ISSUE_TEMPLATE/integration.md | 2 +- CHANGELOG.md | 54 +++++++++++++++++++ CHANGELOG.unreleased.md | 43 --------------- package.json | 2 +- .../versioned_docs/version-stable/options.md | 2 +- .../versioned_docs/version-stable/plugins.md | 4 ++ 7 files changed, 62 insertions(+), 47 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index 0b8edabe6e44..1c6d89d84245 100644 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ b/.github/ISSUE_TEMPLATE/formatting.md @@ -26,7 +26,7 @@ Tip! Don't write this stuff manually. --> -**Prettier 1.16.1** +**Prettier 1.16.2** [Playground link](https://prettier.io/playground/#.....) ```sh # Options (if any): diff --git a/.github/ISSUE_TEMPLATE/integration.md b/.github/ISSUE_TEMPLATE/integration.md index ce866d87db7f..3cef5cf7cf91 100644 --- a/.github/ISSUE_TEMPLATE/integration.md +++ b/.github/ISSUE_TEMPLATE/integration.md @@ -19,7 +19,7 @@ BEFORE SUBMITTING AN ISSUE: --> **Environments:** -- Prettier Version: 1.16.1 +- Prettier Version: 1.16.2 - Running Prettier via: - Runtime: - Operating System: diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f92664095be..8269dbb3d127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,57 @@ +# 1.16.2 + +[diff](https://github.com/prettier/prettier/compare/1.16.1...1.16.2) + +- CLI: Fix CI detection to avoid unwanted TTY behavior ([#5804] by [@kachkaev]) + + In Prettier 1.16.0 and 1.16.1, `--list-different` and `--check` logged every file in some CI environments, instead of just unformatted files. + This unwanted behavior is now fixed. + +- HTML: Do not format non-normal whitespace as normal whitespace ([#5797] by [@ikatyang]) + + Previously, only non-breaking whitespaces (U+00A0) are marked as non-normal whitespace, + which means other non-normal whitespaces such as non-breaking narrow whitespaces (U+202F) + could be formatted as normal whitespaces, which breaks the output. We now follow the spec to + exclude all non-[ASCII whitespace](https://infra.spec.whatwg.org/#ascii-whitespace) from whitespace normalization. + + (`·` represents a non-breaking narrow whitespace) + + + ```html + + Prix·:·32·€ + + + Prix : 32 € + + + Prix·:·32·€ + ``` + +- JavaScript: Fix record type cast comment detection ([#5793] by [@yangsu]) + + Previously, type cast comments with record types were ignored and prettier + stripped the subsequent parens. Prettier 1.16.2 handles these cases correctly. + + + ```js + // Input + const v = /** @type {{key: number}} */ (value); + + // Output (Prettier 1.16.1) + const v = /** @type {{key: number}} */ value; + + // Output (Prettier 1.16.2) + const v = /** @type {{key: number}} */ (value); + ``` + +[@ikatyang]: https://github.com/ikatyang +[@kachkaev]: https://github.com/kachkaev +[@yangsu]: https://github.com/yangsu +[#5793]: https://github.com/prettier/prettier/pull/5793 +[#5797]: https://github.com/prettier/prettier/pull/5797 +[#5804]: https://github.com/prettier/prettier/pull/5804 + # 1.16.1 [diff](https://github.com/prettier/prettier/compare/1.16.0...1.16.1) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 8efaf0146b8e..7b5a8f5be608 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -41,46 +41,3 @@ Examples: ``` --> - -- CLI: Fix CI detection to avoid unwanted TTY behavior ([#5804] by [@kachkaev]) - - In Prettier 1.16.0 and 1.16.1, `--list-different` and `--check` logged every file in some CI environments, instead of just unformatted files. - This unwanted behavior is now fixed. - -- HTML: Do not format non-normal whitespace as normal whitespace ([#5797] by [@ikatyang]) - - Previously, only non-breaking whitespaces (U+00A0) are marked as non-normal whitespace, - which means other non-normal whitespaces such as non-breaking narrow whitespaces (U+202F) - could be formatted as normal whitespaces, which breaks the output. We now follow the spec to - exclude all non-[ASCII whitespace](https://infra.spec.whatwg.org/#ascii-whitespace) from whitespace normalization. - - (`·` represents a non-breaking narrow whitespace) - - - ```html - - Prix·:·32·€ - - - Prix : 32 € - - - Prix·:·32·€ - ``` - -- JavaScript: fix record type cast comment detection ([#5793] by [@yangsu]) - - Previously, type cast comments with record types were ignored and prettier - stripped the subsequent parens. Prettier master handles these cases correctly. - - - ```js - // Input - const v = /** @type {{key: number}} */ (value); - - // Output (Prettier stable) - const v = /** @type {{key: number}} */ value; - - // Output (Prettier master) - const v = /** @type {{key: number}} */ (value); - ``` diff --git a/package.json b/package.json index e86586ddbe3c..4b1c8d0ca40f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prettier", - "version": "1.17.0-dev", + "version": "1.16.2", "description": "Prettier is an opinionated code formatter", "bin": { "prettier": "./bin/prettier.js" diff --git a/website/versioned_docs/version-stable/options.md b/website/versioned_docs/version-stable/options.md index 097479a673c7..b691df97f33e 100644 --- a/website/versioned_docs/version-stable/options.md +++ b/website/versioned_docs/version-stable/options.md @@ -184,7 +184,7 @@ Valid options: - `"babel"` (via [@babel/parser](https://github.com/babel/babel/tree/master/packages/babel-parser)) _Named `"babylon"` until v1.16.0_ - `"babel-flow"` (Same as `"babel"` but enables Flow parsing explicitly to avoid ambiguity) _First available in v1.16.0_ - `"flow"` (via [flow-parser](https://github.com/facebook/flow/tree/master/src/parser)) -- `"typescript"` (via [typescript-estree](https://github.com/JamesHenry/typescript-estree)) _First available in v1.4.0_ +- `"typescript"` (via [@typescript-eslint/typescript-estree](https://github.com/typescript-eslint/typescript-eslint)) _First available in v1.4.0_ - `"css"` (via [postcss-scss](https://github.com/postcss/postcss-scss) and [postcss-less](https://github.com/shellscape/postcss-less), autodetects which to use) _First available in v1.7.1_ - `"scss"` (same parsers as `"css"`, prefers postcss-scss) _First available in v1.7.1_ - `"less"` (same parsers as `"css"`, prefers postcss-less) _First available in v1.7.1_ diff --git a/website/versioned_docs/version-stable/plugins.md b/website/versioned_docs/version-stable/plugins.md index 3ce00324d24c..4109dcef6bad 100644 --- a/website/versioned_docs/version-stable/plugins.md +++ b/website/versioned_docs/version-stable/plugins.md @@ -246,6 +246,10 @@ isPreviousLineEmpty(text: string, node: object, options: object): boolean; mapDoc(doc: object, callback: function): void; ``` +### Tutorials + +- [How to write a plugin for Prettier](https://medium.com/@fvictorio/how-to-write-a-plugin-for-prettier-a0d98c845e70): Teaches you how to write a very basic Prettier plugin for TOML. + ## Testing Plugins Since plugins can be resolved using relative paths, when working on one you can do: