From 8ce393a425d77d18f4632931471ace1bcb5a6e2c Mon Sep 17 00:00:00 2001 From: Joseph Frazier <1212jtraceur@gmail.com> Date: Wed, 10 May 2017 11:15:11 -0400 Subject: [PATCH] Remove trailing whitespace from src/ and markdown files (#1576) --- CHANGELOG.md | 32 ++++++++++++++++---------------- README.md | 8 ++++---- editors/jetbrains/README.md | 6 +++--- src/doc-printer.js | 2 +- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3a234981..ffd88d7c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -184,22 +184,22 @@ [link](https://github.com/jlongster/prettier/compare/0.19.0...0.20.0) -* Fix extra parens for update expressions (#796) -* Fix empty options (#803) -* Eagerly evaluate `ifBreak` when processing template literals (fixes #795 -* Fix function declaration params comments (#802) -* Update flow to 0.40 (#808) -* Correct link for travis -* Fix function call args (#809) -* Properly support `do` (#811) -* Do not put parenthesis around not named default export (#819) -* Adds another preset to related projects (#820) -* Fix trailing commas in docs (#825) -* Put short body of arrow functions on the same line (#829) -* Preserve new lines for comments after `=` (#830) -* Fix indentation of a merged group (#828) -* Migrate class comments to the beginning (#831) -* Update list of related projects (#833) +* Fix extra parens for update expressions (#796) +* Fix empty options (#803) +* Eagerly evaluate `ifBreak` when processing template literals (fixes #795 +* Fix function declaration params comments (#802) +* Update flow to 0.40 (#808) +* Correct link for travis +* Fix function call args (#809) +* Properly support `do` (#811) +* Do not put parenthesis around not named default export (#819) +* Adds another preset to related projects (#820) +* Fix trailing commas in docs (#825) +* Put short body of arrow functions on the same line (#829) +* Preserve new lines for comments after `=` (#830) +* Fix indentation of a merged group (#828) +* Migrate class comments to the beginning (#831) +* Update list of related projects (#833) * Allow breaking for logical expressions in member chains (#827) # 0.19.0 diff --git a/README.md b/README.md index 15798438c..075cc3af9 100644 --- a/README.md +++ b/README.md @@ -161,9 +161,9 @@ Note that `--write` cannot be used with `--debug-check`. #### Pre-commit hook for changed files -You can use this with a pre-commit tool. This can re-format your files that are marked as "staged" via `git add` before you commit. +You can use this with a pre-commit tool. This can re-format your files that are marked as "staged" via `git add` before you commit. -##### 1. [lint-staged](https://github.com/okonet/lint-staged) +##### 1. [lint-staged](https://github.com/okonet/lint-staged) Install it along with [husky](https://github.com/typicode/husky): @@ -201,9 +201,9 @@ Just copy the following config in your pre-commit config yaml file hooks: - id: prettier additional_dependencies: ['prettier@1.1.0'] - + ``` - + Find more info from [here](https://github.com/awebdeveloper/pre-commit-prettier) ##### 3. bash script diff --git a/editors/jetbrains/README.md b/editors/jetbrains/README.md index d02481b47..febdce9b2 100644 --- a/editors/jetbrains/README.md +++ b/editors/jetbrains/README.md @@ -8,7 +8,7 @@ Go to *File | Settings | Tools | External Tools* for Windows and Linux or *WebSt > If on the other hand you have `prettier` installed locally, replace the **Program** with `./node_modules/.bin/prettier` (on OS X and Linux) or `.\node_modules\.bin\prettier.cmd` (on Windows). -* **Parameters** set `--write [other opts] $FilePathRelativeToProjectRoot$` +* **Parameters** set `--write [other opts] $FilePathRelativeToProjectRoot$` * **Working directory** set `$ProjectFileDir$` ![Example](https://raw.githubusercontent.com/prettier/prettier/master/editors/jetbrains/with-prettier.png) @@ -16,7 +16,7 @@ Go to *File | Settings | Tools | External Tools* for Windows and Linux or *WebSt ### Process directories * Clone the External tool created above and name it `Prettier Directories` -* **Parameters** set `--write [other opts] $FileDirRelativeToProjectRoot$/**/(*.js|*.jsx)` +* **Parameters** set `--write [other opts] $FileDirRelativeToProjectRoot$/**/(*.js|*.jsx)` ## Usage @@ -36,5 +36,5 @@ To automatically format using `prettier` on save, you can use a file watcher. Go to *File | Settings | Tools | File Watchers* for Windows and Linux or *WebStorm | Preferences | Tools | File Watchers* for OS X and click **+** to add a new tool. Let’s name it **Prettier**. * **Program** set the full path to a `prettier` executable, such as `/Users/developer/repo/jest/node_modules/.bin/prettier` (on OS X and Linux) or `C:/\Users\developer\repo\jest\node_modules\.bin\prettier.cmd` (on Windows). -* **Parameters** set `--write [other opts] $FilePath$` +* **Parameters** set `--write [other opts] $FilePath$` * **Working directory** set `$ProjectFileDir$` diff --git a/src/doc-printer.js b/src/doc-printer.js index d78101d42..64018cc2d 100644 --- a/src/doc-printer.js +++ b/src/doc-printer.js @@ -288,7 +288,7 @@ function printDocToString(doc, options) { out[out.length - 1] = out[out.length - 1].replace( /[^\S\n]*$/, "" - ); + ); } }