Commit Graph

2767 Commits (fa40f2ddd3dcbace78b0d90cfe62c7903acf0892)

Author SHA1 Message Date
Ika fa40f2ddd3
docs(blog): 1.15 release (#5296) 2018-11-07 09:09:04 +08:00
Ika 4559a774bb Release 1.15.0 2018-11-07 09:07:53 +08:00
Brian Ng e882452c54 Bump @babel/parser (#5356)
Follows #5304 with flow inexact support in @babel/parser!
2018-11-07 08:42:11 +08:00
Ika 40ac85125a
fix(html-in-js): do not break empty content (#5355) 2018-11-07 08:32:26 +08:00
Ika a4e8aaf7a1
fix(jsx): do not move trailing char to the next line as leading char (#5354) 2018-11-07 07:41:34 +08:00
Tim Upchurch f9bce75034 Update language support docs (#5178)
* Update language support docs

This commit updates docs language to reflect the change in #4528 that removes the inferred default parser.

* Remove language-support.md docs file

This removes the language support doc file as information is out dated, or available elsewhere in the docs.

* removes language-support from sidebars config
2018-11-06 19:23:04 -02:00
Ika 6a54e21c12
fix(css-in-js): do not remove semicolon (#5353) 2018-11-07 00:19:42 +08:00
Alexander Kachkaev b87fe4cf22 Add option to enforce certain line endings (#5327) 2018-11-06 22:47:13 +08:00
Ika 40f46740f6
fix(jsx): consistent quotes in JSX expression (#5349) 2018-11-06 15:38:50 +08:00
Ika b6691ba615
fix(javascript): no regression for jsx in arrow function in jsx (#5343) 2018-11-06 15:38:30 +08:00
Thomas Bartel dbe86abc24 Make ast-to-doc.js a little easier to understand (#5346)
Rename genericPrint function to callPluginPrintFunction to avoid similar name to printGenerically
Add comments that explain the descent/recursion
2018-11-05 07:34:27 -08:00
Ika e022abc9b8
chore(playground): add a temporary workaround for parser-vue (#5347)
Temporary workaround
2018-11-05 22:11:59 +08:00
Ika 02f9802119
fix(javascript): no regression for ternary#test alignment (#5333) 2018-11-05 17:07:57 +08:00
Simon Lydell e2d8834c49 Fix link to jsx-single-quotes option 2018-11-05 09:37:30 +01:00
Jed Fox 2136fdc858 Add a preview playground redirect page (#5321)
* Add a preview playground redirect page

* Finish the code

* Third time’s the charm

* Use location.replace instead

* Add playground redirect link to PR template

* Formatted with latest Prettier :)

https://deploy-preview-5259--prettier.netlify.com/playground/#N4Igxg9gdgLgprEAuEAeAhAEQPIGEAqAmgAoCiABABYwC2ANgHwA6Uq19zrlcAhgCady5VDTgwe5MJR4AnAM5iAvExABXGADMAtAA4Vg4TACWMOnAYAlOHyMy4YY1ADmgMgJUAemOnzLD936cqABGEHwAngZsAIyW1rb2jq5+MSxCqAAOsTZ2DkbO5GEQquQwECXc5Dzp6TIQNUY88OTpdDxhTrWqUHwAdOQAkhrlcOR22QnkfBBwclCAmAQw5ADuEDIA1gA0whKUdhrKIABWPABuPHJgMkbpMEiURnKlMmE9QTxgawAUAJT6TmVvD4lMowCrECweHgMSrdSR0IxA0EjKo1OpXRojeFQNY9DyZVLCC5XG4GISQKCPcg0RpSciKcjuAB61Bg6TkSCYTHcnPcThMlFUQU5PUgNB5NTExjgMnFdhgUplXPSqjodB5n05fAA1N93D04AAPeyfKZgVSiWA9PbSuwyX5QIRCIxDT7UmC09D0qAqujfcjAAmOyTQSkAbXcACpyKoZHRyBH3FsagBdOlUmmUQOOugQMCNIzQK1wFrvOCfAAGLLZSHc7j4xZzYS0EpORjgSy0ABJgDUAL5aZtyhU9KBieEaF6i9wl9qdbrl+1B3vkOB0BT+rNkkOLVdp03mhAwEV2DGkMwWmCfADk6Svi6DK7oPXgBpguGg8FgafL+Aq1pktrkAAqhYAAy5CfN2+4XkWGg2tKvZ+ks5zkFAECLDkEBOFARgAF7WH0ADKqzPOQSAVpuky5gelohOEPQoggfC4PcdB8J8q73kIvYEh4RLXDAgTuHRES+O47CMCAGwgHUxghsgoCyLUSzELICByMgICnBARh8FJIBBDI7xrGIhHpO8eROMgMAyKocDSRJADq9zwHI5lgHAhHqSYRitjAYSaWAcgadJeQKDIMDEEZTjUsgGg8Gu9lHHIBoAEJGR8pk8KIoF5HAcUJQo0nmfI0qaRJ+n1LAjm6aCyA6AADMVtQKI5RnpJpErhSc+XSXYACOqjxFFPAxTwBWJdJCg0EY1m2UlciWWYACKqjoflSDxZNIDiEENV8HVSAAEzSTZPBGFiTjvjQsUoGho76aoCj4DwQQaZthVwL2vZAA

* Add a GIF
2018-11-05 00:11:08 +02:00
Stefan Mirea e17512adcd Add an option to print single quotes in JSX (#4798)
* feat(option-singleQuote-jsx): Added jsSingleQuote

* feat(option-singleQuote-jsx): Refactored to use a simple jsxSingleQuote flag

* feat(option-singleQuote-jsx): Fixed borked rebase

* feat(option-singleQuote-jsx): Updated snapshots

* feat(option-singleQuote-jsx): Resolved pending comments

* feat(option-singleQuote-jsx): Removed assert

* Fixed merge conflicts

* Updated snapshots after merge conflicts
2018-11-04 16:36:00 -05:00
Ika f6a95dd2e0 chore(deps): replace parse-srcset with the gh commit one
to avoid potential changes
2018-11-04 23:19:41 +08:00
Ika 5e8a4a115a
feat: support HTML/Vue/Angular (#5259) 2018-11-04 23:03:07 +08:00
Ika 0878a6a3e7
fix(less): remove CRs from inline comments (#5334)
The issue here is that less parser somehow included CRs in `comment.raws.content`, but it was hidden by the wrong trailing space elimination previously, which was fixed by #5165.

We already have such tests but it's not reproducible in AppVeyor since they use LF ([`core.autocrlf=input`](https://stackoverflow.com/a/20653073)).
2018-11-04 11:36:14 +08:00
Simon Lydell 275b0543c8
Never put spaces to the right of stars in indentable block comments (#5330)
Fixes #5323. Previously we added space after `/*` _on the first line
only,_ but the intent is to only fix the indentation of comments, not
changing their "contents". Besides, this was inconsistent with the
handling of every following line. Finally, it broke `/*!` comments which
some minifiers look for to know which (license) comments to keep.

People can use https://eslint.org/docs/rules/spaced-comment to enforce
when to start comments with spaces.
2018-11-03 20:53:24 +01:00
Onur Temizkan f6d8be881c fix(css-in-js) Keep newlines in CSS-in-JS Templates (Fixes: #5147) (#5240)
* fix(css-in-js) Keep newlines in CSS-in-JS Templates (Fixes: #5147)

* Add more tests

* Do not add semicolon when CSS prop is a template variable

* Fix deletion of original semicolon

* Prettify long line
2018-11-01 21:58:16 +02:00
Jaiden Gerig 0799280429 Fixed unstable comment between function declaration and block statement (#5250) 2018-11-01 21:55:33 +02:00
Calum Lind b8ebcd910c Add YAML file extensions to pre-commit hooks config (#5182)
- Prettier support YAML but pre-commit hook was not checking those
  files so added file extensions to hooks config.
- Used double-quoted flow scalar style to make the list of file
  extensions easier to read. Backslash for regex needed escaping and
  backslash each line to prevent YAML including spaces.
- Added alternative markdown file extensions.
2018-11-02 00:21:51 +08:00
Nathan Totten cce4a2683a Added Apex plugin (#5318) 2018-10-31 17:08:56 +02:00
Beau Smith a34b9701e5 Website and Playground Setup and Run Instructions (#5312)
Update readme with steps to setup and run locally. 

Removed note about the need to run two separate processes because `yarn start` was [updated to concurrently runs both processes](ef932741ad (diff-07f3a4647460e74f9514d8def137963a)).
2018-10-31 09:07:20 +08:00
Andrey Okonetchnikov 7238ceffab docs: Remove the warning about partially staged files (#5310)
Since partially staged files are now officially supported, this isn't up to date anymore.
2018-10-29 09:16:28 -03:00
Sibiraj 2402a2a07b build: update editorconfig to resolve a deprecated warning (#5307)
This resolves a deprecated warning when installing prettier.

[image](https://user-images.githubusercontent.com/20282546/47603753-0995a700-da0e-11e8-9c89-61e0ff3d13c9.png)
2018-10-28 15:01:53 +08:00
Ika 907c5cab72
chore(yarn): disable integrity migration
Yarn v1.10 adds `integrity`s but v1.9 removes them.
Add this option to prevent them from adding unnecessary diffs all the time.
This is the default value for Yarn v1.12+ (ref: yarnpkg/yarn#6465).
2018-10-27 21:01:26 +08:00
Jordan Brown b861448dbf Pretty print inexact (#5304) 2018-10-26 21:05:42 +03:00
Jordan Brown 5d47e02f64 Update flow parser to 0.84.0 (#5303) 2018-10-26 22:14:47 +08:00
Beau Smith 6e0de08122 User can copy JSON config from Playground. (#5295) 2018-10-25 17:41:08 -04:00
Aquib Master 1234ceb1d6 Fix flow extends not breaking out into new lines (#5244) 2018-10-25 10:49:53 -04:00
Jaiden Gerig 2cc32da5af Fixed unstable while comment (#5251)
* Fixed unstable while comment

* Aligned while loop formatting more closely with if statment formatting
2018-10-25 10:48:09 -04:00
Ashwin Bhat 253716dd49 Fix Flow generic comment positioning (#5290)
* add test for ensuring that calls with zero arguments look right
2018-10-25 08:44:16 -04:00
Jed Fox 6a174654a4 Fix indentation of block comments where every line starts with a star (#5206)
Previously this was done only for JSDoc comments. Now it's done in a few additional cases.
2018-10-23 21:04:24 +02:00
Ashwin Bhat 4d4fab39fe Add support for flow typecast comments (#5280)
* Add support for flow typecast comments

* Allow whitespace between comment start and colon

Also rename flow-comments.js to utils.js

* fix bug where type annotations could be accidentally created

* use better regex in detecting flow comment whitespace

* fix comment in utils.js

* simplify conditionals and improve comments

* fix lint error
2018-10-23 10:46:20 -04:00
Gilles Debunne 559831d08e Update husky integration code for husky v1.0.0 (#5266)
Latest husky (version 1.0.0) moved its hooks config from the `scripts` field to a new `husky` field in `package.json` ([ChangeLog](https://github.com/typicode/husky/blob/master/CHANGELOG.md)).

The `scripts` syntax described here, although shorter, will be deprecated soon. This change replaces it with the new husky syntax.

The new syntax is already used in [precommit.md](https://github.com/prettier/prettier/blob/master/docs/precommit.md).
2018-10-21 23:28:19 +08:00
Lucas Azzola d1d1f17157
Update some plugin links (#5282)
Looks like they were overlooked.
2018-10-20 12:40:09 +11:00
Lucas Duailibe 62e4654e60
Respect original text decorator order (#5207) 2018-10-17 14:14:59 -03:00
Evilebot Tnawi 023a8b78df feat: more shared utils for plugins (#5254) 2018-10-17 07:53:38 -07:00
Chris Adams 4cc0363b40 Remove HTML from pre-commit hooks until available (#5274)
The pre-commit hook registers for HTML files but that will always fail until #5098 is completed. This means that anyone following [the instructions](https://prettier.io/docs/en/precommit.html#option-3-pre-commit-https-githubcom-pre-commit-pre-commit) will have the hook fail any time they attempt to commit an HTML file.
2018-10-17 08:40:04 +08:00
Raphael Boidol 59c075b311 [ImgBot] optimizes images (#5261)
*Total -- 1,155.42kb -> 742.94kb (35.7%)

/website/static/images/users/iress-200x100.png -- 78.46kb -> 4.68kb (94.03%)
/website/static/images/users/assertible-200x100.png -- 31.41kb -> 2.68kb (91.47%)
/website/static/images/users/sevenspan-200x100.png -- 19.97kb -> 5.77kb (71.09%)
/website/static/icon.png -- 4.47kb -> 1.72kb (61.45%)
/website/static/images/users/zipch-200x100.png -- 3.91kb -> 1.64kb (58.04%)
/website/static/images/users/discord-200x100.png -- 3.18kb -> 1.42kb (55.5%)
/website/static/images/users/nrwl-200x100.png -- 25.42kb -> 11.47kb (54.89%)
/website/static/images/users/loyaltylion-200x100.png -- 5.14kb -> 2.49kb (51.58%)
/website/static/images/users/drizly-200x100.png -- 7.02kb -> 3.44kb (50.94%)
/website/static/images/users/mathrioshka-200x100.png -- 37.09kb -> 19.25kb (48.1%)
/website/static/images/users/troops-200x100.png -- 6.75kb -> 3.54kb (47.61%)
/website/static/images/languages/markdown-128px.png -- 3.66kb -> 1.93kb (47.29%)
/website/static/images/users/eyesquare-200x100.png -- 10.26kb -> 5.49kb (46.53%)
/website/static/images/editors/webstorm-128px.png -- 6.64kb -> 3.77kb (43.18%)
/website/static/images/editors/atom-128px.png -- 8.66kb -> 5.07kb (41.45%)
/website/static/images/users/lifesum-200x100.png -- 12.70kb -> 7.45kb (41.33%)
/website/static/images/users/brigad-200x100.png -- 13.67kb -> 8.06kb (41.02%)
/website/static/images/users/holidaycheck-200x100.png -- 13.79kb -> 8.30kb (39.81%)
/website/static/images/users/outreach-200x100.png -- 8.52kb -> 5.36kb (37.13%)
/website/static/images/users/hudl-200x100.png -- 8.77kb -> 5.56kb (36.66%)
/website/static/images/editors/visualstudio-128px.png -- 3.13kb -> 1.98kb (36.62%)
/website/static/images/languages/js-128px.png -- 3.34kb -> 2.12kb (36.62%)
/website/blog/assets/github-diff-ternary-in-jsx.png -- 67.71kb -> 44.43kb (34.37%)
/website/static/images/users/getonboard-200x100.png -- 5.53kb -> 3.74kb (32.43%)
/website/static/images/users/hackclub-200x100.png -- 7.90kb -> 5.44kb (31.13%)
/website/static/prettier.png -- 16.74kb -> 11.61kb (30.62%)
/docs/assets/youtube-cover/a-prettier-printer-by-james-long-on-react-conf-2017.png -- 328.21kb -> 230.23kb (29.85%)
/website/static/images/users/transloadit-200x100.png -- 10.47kb -> 7.47kb (28.66%)
/website/static/images/users/paypal-200x100.png -- 12.50kb -> 8.94kb (28.5%)
/website/static/images/users/mongodb-200x100.png -- 9.72kb -> 6.99kb (28.08%)
/website/static/images/languages/graphql-128px.png -- 8.10kb -> 5.85kb (27.71%)
/docs/assets/youtube-cover/javascript-code-formatting-by-christopher-chedeau-on-react-london-2017.png -- 137.75kb -> 100.08kb (27.34%)
/website/static/images/users/codemix-200x100.png -- 3.82kb -> 2.87kb (24.92%)
/website/static/images/users/m6web-200x100.png -- 21.61kb -> 16.69kb (22.78%)
/website/static/images/users/yelp-200x100.png -- 10.59kb -> 8.23kb (22.35%)
/website/static/images/users/react-200x100.png -- 6.72kb -> 5.23kb (22.13%)
/website/static/images/users/babel-200x100.png -- 15.44kb -> 12.08kb (21.76%)
/website/static/images/users/freelancer-200x100.png -- 5.86kb -> 4.74kb (19.08%)
/website/static/images/users/ideati-200x100.png -- 4.05kb -> 3.29kb (18.62%)
/website/static/images/users/yarn-200x100.png -- 5.75kb -> 4.71kb (18.07%)
/website/static/images/users/talkable-200x100.png -- 3.07kb -> 2.56kb (16.63%)
/website/static/images/users/webpack-200x100.png -- 5.13kb -> 4.44kb (13.49%)
/website/static/images/users/escrow-200x100.png -- 7.47kb -> 6.48kb (13.25%)
/website/static/images/users/moonmail-200x100.png -- 5.69kb -> 4.96kb (12.87%)
/website/static/images/users/jest-200x100.png -- 3.26kb -> 2.84kb (12.86%)
/website/static/images/editors/vim-128px.png -- 13.85kb -> 12.16kb (12.19%)
/website/static/images/users/nhl-200x100.png -- 11.18kb -> 9.85kb (11.92%)
/website/static/images/editors/emacs-128px.png -- 21.24kb -> 18.90kb (11.03%)
/website/static/images/users/jane-200x100.png -- 4.14kb -> 3.70kb (10.71%)
/website/static/images/users/webflow-200x100.png -- 4.51kb -> 4.08kb (9.49%)
/website/static/images/users/storybook-200x100.png -- 6.04kb -> 5.49kb (9.11%)
/website/static/images/editors/vscode-128px.png -- 14.85kb -> 13.53kb (8.9%)
/website/static/images/editors/sublimetext-128px.png -- 6.83kb -> 6.39kb (6.55%)
/website/static/images/users/zeit-200x100.png -- 0.94kb -> 0.88kb (6.45%)
/website/static/images/users/smooth-code-200x100.png -- 9.16kb -> 8.66kb (5.49%)
/website/static/images/languages/css-128px.png -- 7.21kb -> 6.87kb (4.79%)
/website/static/images/users/rnfirebase-200x100.png -- 8.63kb -> 8.26kb (4.28%)
/website/static/images/editors/espresso-128px.png -- 22.42kb -> 21.78kb (2.84%)
/website/static/images/users/monei-200x100.png -- 5.35kb -> 5.31kb (0.75%)
2018-10-16 15:07:33 -03:00
Vojtech Novak caa7b425b7 Update eslint.md (#5276) 2018-10-16 14:11:14 -03:00
Lucas Duailibe 00004daf84
Break nested TSConditionalType (#5272) 2018-10-15 13:35:37 -03:00
Suchipi 0fa34b2c63 Print nested ternaries differently (#5039) 2018-10-14 12:45:37 -03:00
Jed Fox b61fec6091
Fix <Language showName /> prop type (#5265)
There isn‘t a `boolean` prop type, so this was throwing an error when Netlify built the site.
2018-10-14 08:03:35 -04:00
Lucas Duailibe c7093cb3e4
Add ASI protection for TSNonNullExpression (#5262) 2018-10-13 20:03:51 -03:00
Ika dd4687e7ef
feat(html): whitespace-sensitive formatting (#5168)
- whitespace-sensitive formatting 
  - respect css `display: block`/`white-space: pre` (data from [`html-styles`](https://github.com/marionebl/html-styles))
  - support magic comment (`<!-- display: block -->`)
  - add an option to specify whitespace sensitivity (`--html-whitespace-sensitivity <css|strict|ignore>`)
    - magic comments take precedence
    - (default) `css`: respect default css style (safe in the most cases)
    - `strict`: every node is considered whitespace sensitive (the safest)
    - `ignore`: every node is considered whitespace insensitive (dangerous, the original behavior)
  - inline inline-tags 
- support ie conditional comment (`<!--[if IE]><![endif]-->`)
- indent the script/style content
- no inconsistent output for 2+ attributes
- force break tag if there're multiline attributes
2018-10-13 13:55:38 +08:00
Aquib Master 3369be0ca2 Fix comment issue with try finally (#5252) 2018-10-12 12:48:49 -04:00
Jed Fox 65b2454dd8
Improved object-break heuristic (#5205) 2018-10-12 12:45:30 -04:00