Skip to content

Commit

Permalink
Release 1.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lydell committed Nov 9, 2019
1 parent 057e15d commit e788e8d
Show file tree
Hide file tree
Showing 16 changed files with 54 additions and 30 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.18.2**
**Prettier 1.19.0**
[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.18.2
- Prettier Version: 1.19.0
- 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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.19.0

[diff](https://github.com/prettier/prettier/compare/1.18.2...1.19.0)

🔗 [Release Notes](https://prettier.io/blog/2019/11/09/1.19.0.html)

# 1.18.2

[diff](https://github.com/prettier/prettier/compare/1.18.1...1.18.2)
Expand Down
12 changes: 6 additions & 6 deletions docs/browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ See [Usage](#usage) below for examples.
### Global

```html
<script src="https://unpkg.com/prettier@1.18.2/standalone.js"></script>
<script src="https://unpkg.com/prettier@1.18.2/parser-graphql.js"></script>
<script src="https://unpkg.com/prettier@1.19.0/standalone.js"></script>
<script src="https://unpkg.com/prettier@1.19.0/parser-graphql.js"></script>
<script>
prettier.format("query { }", {
parser: "graphql",
Expand All @@ -42,8 +42,8 @@ prettier.format("query { }", {

```js
define([
"https://unpkg.com/prettier@1.18.2/standalone.js",
"https://unpkg.com/prettier@1.18.2/parser-graphql.js"
"https://unpkg.com/prettier@1.19.0/standalone.js",
"https://unpkg.com/prettier@1.19.0/parser-graphql.js"
], (prettier, ...plugins) => {
prettier.format("query { }", { parser: "graphql", plugins });
});
Expand All @@ -62,7 +62,7 @@ This syntax doesn't necessarily work in the browser, but it can be used when bun
### Worker

```js
importScripts("https://unpkg.com/prettier@1.18.2/standalone.js");
importScripts("https://unpkg.com/prettier@1.18.2/parser-graphql.js");
importScripts("https://unpkg.com/prettier@1.19.0/standalone.js");
importScripts("https://unpkg.com/prettier@1.19.0/parser-graphql.js");
prettier.format("query { }", { parser: "graphql", plugins: prettierPlugins });
```
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.19.0-beta.1",
"version": "1.19.0",
"description": "Prettier is an opinionated code formatter",
"bin": {
"prettier": "./bin/prettier.js"
Expand Down
4 changes: 3 additions & 1 deletion website/versioned_docs/version-stable/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ prettier.resolveConfig(filePath).then(options => {
});
```

If `options.editorconfig` is `true` and an [`.editorconfig` file](http://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:
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:

- `end_of_line`
- `indent_style`
Expand Down Expand Up @@ -101,6 +101,8 @@ Setting `options.ignorePath` (`string`) and `options.withNodeModules` (`boolean`

Providing [plugin](plugins.md) paths in `options.plugins` (`string[]`) helps extract `inferredParser` for files that are not supported by Prettier core.

When setting `options.resolveConfig` (`boolean`, default `false`), Prettier will resolve the configuration for the given `filePath`. This is useful, for example, when the `inferredParser` might be overridden for a subset of files.

Use `prettier.getFileInfo.sync(filePath [, options])` if you'd like to use sync version.

## `prettier.getSupportInfo([version])`
Expand Down
22 changes: 12 additions & 10 deletions website/versioned_docs/version-stable/browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Browser
original_id: browser
---

Run Prettier in the browser with the `standalone.js` UMD bundle shipped in the NPM package (starting in version 1.13). The new 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 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.

### `prettier.format(code, options)`

Expand All @@ -16,12 +16,14 @@ See [Usage](#usage) below for examples.

### Global

<!-- prettier-ignore -->
```html
<script src="https://unpkg.com/prettier@1.13.0/standalone.js"></script>
<script src="https://unpkg.com/prettier@1.13.0/parser-graphql.js"></script>
<script type="text/javascript">
prettier.format("query { }", { parser: "graphql", plugins: prettierPlugins });
<script src="https://unpkg.com/prettier@1.19.0/standalone.js"></script>
<script src="https://unpkg.com/prettier@1.19.0/parser-graphql.js"></script>
<script>
prettier.format("query { }", {
parser: "graphql",
plugins: prettierPlugins
});
</script>
```

Expand All @@ -41,8 +43,8 @@ prettier.format("query { }", {

```js
define([
"https://unpkg.com/prettier@1.13.0/standalone.js",
"https://unpkg.com/prettier@1.13.0/parser-graphql.js"
"https://unpkg.com/prettier@1.19.0/standalone.js",
"https://unpkg.com/prettier@1.19.0/parser-graphql.js"
], (prettier, ...plugins) => {
prettier.format("query { }", { parser: "graphql", plugins });
});
Expand All @@ -61,7 +63,7 @@ This syntax doesn't necessarily work in the browser, but it can be used when bun
### Worker

```js
importScripts("https://unpkg.com/prettier@1.13.0/standalone.js");
importScripts("https://unpkg.com/prettier@1.13.0/parser-graphql.js");
importScripts("https://unpkg.com/prettier@1.19.0/standalone.js");
importScripts("https://unpkg.com/prettier@1.19.0/parser-graphql.js");
prettier.format("query { }", { parser: "graphql", plugins: prettierPlugins });
```
4 changes: 1 addition & 3 deletions website/versioned_docs/version-stable/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ In practice, this may look something like:
prettier --single-quote --trailing-comma es5 --write "{app,__{tests,mocks}__}/**/*.js"
```

Don't forget the quotes around the globs! The quotes make sure that Prettier expands the globs rather than your shell, for cross-platform usage. The [glob syntax from the `fast-glob` module](https://github.com/mrmlnc/fast-glob/blob/master/README.md#pattern-syntax) is used.
Don't forget the quotes around the globs! The quotes make sure that Prettier expands the globs rather than your shell, for cross-platform usage. The [glob syntax from the glob module](https://github.com/isaacs/node-glob/blob/master/README.md#glob-primer) is used.

Prettier CLI will ignore files located in `node_modules` directory. To opt-out from this behavior use `--with-node-modules` flag.

Expand Down Expand Up @@ -149,8 +149,6 @@ Prettier CLI will ignore files located in `node_modules` directory. To opt-out f

This rewrites all processed files in place. This is comparable to the `eslint --fix` workflow.

To avoid re-checking unchanged files, use the `--only-changed` flag.

## `--loglevel`

Change the level of logging for the CLI. Valid options are:
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-stable/comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ original_id: comparison

Linters have two categories of rules:

**Formatting rules**: eg: [max-len](http://eslint.org/docs/rules/max-len), [no-mixed-spaces-and-tabs](http://eslint.org/docs/rules/no-mixed-spaces-and-tabs), [keyword-spacing](http://eslint.org/docs/rules/keyword-spacing), [comma-style](http://eslint.org/docs/rules/comma-style)...
**Formatting rules**: eg: [max-len](https://eslint.org/docs/rules/max-len), [no-mixed-spaces-and-tabs](https://eslint.org/docs/rules/no-mixed-spaces-and-tabs), [keyword-spacing](https://eslint.org/docs/rules/keyword-spacing), [comma-style](https://eslint.org/docs/rules/comma-style)...

Prettier alleviates the need for this whole category of rules! Prettier is going to reprint the entire program from scratch in a consistent way, so it's not possible for the programmer to make a mistake there anymore :)

**Code-quality rules**: eg [no-unused-vars](http://eslint.org/docs/rules/no-unused-vars), [no-extra-bind](http://eslint.org/docs/rules/no-extra-bind), [no-implicit-globals](http://eslint.org/docs/rules/no-implicit-globals), [prefer-promise-reject-errors](http://eslint.org/docs/rules/prefer-promise-reject-errors)...
**Code-quality rules**: eg [no-unused-vars](https://eslint.org/docs/rules/no-unused-vars), [no-extra-bind](https://eslint.org/docs/rules/no-extra-bind), [no-implicit-globals](https://eslint.org/docs/rules/no-implicit-globals), [prefer-promise-reject-errors](https://eslint.org/docs/rules/prefer-promise-reject-errors)...

Prettier does nothing to help with those kind of rules. They are also the most important ones provided by linters as they are likely to catch real bugs with your code!
2 changes: 1 addition & 1 deletion website/versioned_docs/version-stable/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ singleQuote = true

Overrides let you have different configuration for certain file extensions, folders and specific files.

Prettier borrows ESLint’s [override format](http://eslint.org/docs/user-guide/configuring#example-configuration).
Prettier borrows ESLint’s [override format](https://eslint.org/docs/user-guide/configuring#example-configuration).

JSON:

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-stable/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Prettier is an opinionated code formatter with support for:
- [Markdown](https://commonmark.org/), including [GFM](https://github.github.com/gfm/) and [MDX](https://mdxjs.com/)
- [YAML](https://yaml.org/)

It removes all original styling[\*](#footnotes) and ensures that all outputted code conforms to a consistent style. (See this [blog post](http://jlongster.com/A-Prettier-Formatter))
It removes all original styling[\*](#footnotes) and ensures that all outputted code conforms to a consistent style. (See this [blog post](https://jlongster.com/A-Prettier-Formatter))

Prettier takes your code and reprints it from scratch by taking the line length into account.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Then in `tslint.json`:

### Disable formatting rules

[`stylelint-config-prettier`](https://github.com/prettier/stylelint-config-prettier) is a config that disables rules that conflict with Prettier. Add it to your [`devDependencies`], then extend from it within your `.stylelintrc` configuration. Make sure to put it last in the `extends` array, so it gets the chance to override other configs.
[`stylelint-config-prettier`](https://github.com/prettier/stylelint-config-prettier) is a config that disables rules that conflict with Prettier. Add it to your `devDependencies`, then extend from it within your `.stylelintrc` configuration. Make sure to put it last in the `extends` array, so it gets the chance to override other configs.

```bash
yarn add --dev stylelint-config-prettier
Expand Down
15 changes: 15 additions & 0 deletions website/versioned_docs/version-stable/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,21 @@ Valid options:
| ------- | ------------------------------------------------------------------------ | ----------------------------------------------------------------------- |
| `"css"` | <code>--html-whitespace-sensitivity <css&#124;strict&#124;ignore></code> | <code>htmlWhitespaceSensitivity: "<css&#124;strict&#124;ignore>"</code> |

## Vue files script and style tags indentation

_First available in v1.19.0_

Whether or not to indent the code inside `<script>` and `<style>` tags in Vue files. Some people (like [the creator of Vue](https://github.com/prettier/prettier/issues/3888#issuecomment-459521863)) don’t indent to save an indentation level, but this might break code folding in your editor.

Valid options:

- `"false"` - Do not indent script and style tags in Vue files.
- `"true"` - Indent script and style tags in Vue files.

| Default | CLI Override | API Override |
| ------- | ------------------------------- | --------------------------------- |
| `false` | `--vue-indent-script-and-style` | `vueIndentScriptAndStyle: <bool>` |

## End of Line

_First available in 1.15.0_
Expand Down
1 change: 1 addition & 0 deletions website/versioned_docs/version-stable/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Providing at least one path to `--plugin-search-dir`/`pluginSearchDirs` turns of
- [`prettier-plugin-elm`](https://github.com/gicentre/prettier-plugin-elm) by [**@giCentre**](https://github.com/gicentre)
- [`prettier-plugin-java`](https://github.com/jhipster/prettier-java) by [**@JHipster**](https://github.com/jhipster)
- [`prettier-plugin-kotlin`](https://github.com/Angry-Potato/prettier-plugin-kotlin) by [**@Angry-Potato**](https://github.com/Angry-Potato)
- [`prettier-plugin-package`](https://github.com/shellscape/prettier-plugin-package) by [**@shellscape**](https://github.com/shellscape)
- [`prettier-plugin-packagejson`](https://github.com/matzkoh/prettier-plugin-packagejson) by [**@matzkoh**](https://github.com/matzkoh)
- [`prettier-plugin-pg`](https://github.com/benjie/prettier-plugin-pg) by [**@benjie**](https://github.com/benjie)
- [`prettier-plugin-solidity`](https://github.com/prettier-solidity/prettier-plugin-solidity) by [**@mattiaerre**](https://github.com/mattiaerre)
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-stable/technical-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Technical Details
original_id: technical-details
---

This printer is a fork of [recast](https://github.com/benjamn/recast)'s printer with its algorithm replaced by the one described by Wadler in "[A prettier printer](http://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf)". There still may be leftover code from recast that needs to be cleaned up.
This printer is a fork of [recast](https://github.com/benjamn/recast)'s printer with its algorithm replaced by the one described by Wadler in "[A prettier printer](https://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf)". There still may be leftover code from recast that needs to be cleaned up.

The basic idea is that the printer takes an AST and returns an intermediate representation of the output, and the printer uses that to generate a string. The advantage is that the printer can "measure" the IR and see if the output is going to fit on a line, and break if not.

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-stable/webstorm.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ In older IDE versions, select Custom and do the following configuration:

### Using Prettier with ESLint

If you are using ESLint with [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier), use the `Fix ESLint Problems` action to reformat the currect file – find it using _Find Action_ (`Cmd/Ctrl-Shift-A`) or [add a keyboard shortcut](https://www.jetbrains.com/help/webstorm/configuring-keyboard-shortcuts.html) to it in _Preferences | Keymap_ and then use it.
If you are using ESLint with [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier), use the `Fix ESLint Problems` action to reformat the current file – find it using _Find Action_ (`Cmd/Ctrl-Shift-A`) or [add a keyboard shortcut](https://www.jetbrains.com/help/webstorm/configuring-keyboard-shortcuts.html) to it in _Preferences | Keymap_ and then use it.

Make sure that the ESLint integration is enabled in _Preferences | Languages & Frameworks | JavaScript | Code Quality Tools | ESLint_.

Expand Down

0 comments on commit e788e8d

Please sign in to comment.