Skip to content

Commit

Permalink
Release 1.16.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ikatyang committed Jan 30, 2019
1 parent 47da080 commit 3c56b9a
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BEFORE SUBMITTING AN ISSUE:
-->

**Environments:**
- Prettier Version: 1.16.1
- Prettier Version: 1.16.2
- Running Prettier via: <!-- CLI, Node.js API, Browser API, etc. -->
- Runtime: <!-- Node.js v6, Chrome v67, etc. -->
- Operating System: <!-- Windows, Linux, macOS, etc. -->
Expand Down
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

<!-- prettier-ignore -->
```html
<!-- Input -->
Prix·:·32·€

<!-- Output (Prettier 1.16.1) -->
Prix : 32 €

<!-- Output (Prettier 1.16.2) -->
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.

<!-- prettier-ignore -->
```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)
Expand Down
43 changes: 0 additions & 43 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<!-- prettier-ignore -->
```html
<!-- Input -->
Prix·:·32·€

<!-- Output (Prettier stable) -->
Prix : 32 €

<!-- Output (Prettier master) -->
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.

<!-- prettier-ignore -->
```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);
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-stable/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down
4 changes: 4 additions & 0 deletions website/versioned_docs/version-stable/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3c56b9a

Please sign in to comment.