Commit Graph

2434 Commits (b0cb63a7bb8e038557c79c8fdf9676c1c76465d7)

Author SHA1 Message Date
Lucas Azzola b0cb63a7bb
Use destructuring for imports (#4554)
* Use destructuring for imports

* Clean up integration tests

* Use moduleNameMapper for require_prettier
2018-05-27 21:36:12 +10:00
Suchipi 5508546de8
Add formatWithCursor, check, doc, and util to the standalone build (#4556)
* Add formatWithCursor, check, and doc to the standalone build

* Add util, too
2018-05-26 17:25:36 -06:00
Brian Ng fda7bf59f4
Add support for Flow's proto modifier syntax (#4551)
Flow commit: eb815be907

Babel PR: https://github.com/babel/babel/pull/7978
2018-05-25 17:23:17 -05:00
Brian Ng d20d9c160e
Switch to @babel/parser (#4544)
We landed a change that added a new `InterpreterDirective` AST node type for hashbangs, and no longer add it as a comment/leadingComment.

Ref: https://github.com/babel/babel/pull/7928

I mimicked what we do in `@babel/generator` here, since I found it better than trying to add comments to the ast in `parser-include-shebang.js`). Definitely open to a better/cleaner option though!

Note: I'll follow this up with enabling tests for https://github.com/prettier/prettier/pull/4543 and https://github.com/prettier/prettier/pull/4540 once they land too.
2018-05-25 11:27:41 -05:00
Lucas Duailibe 174a7736c1
[build] Always transpile everything (#4548) 2018-05-25 12:47:01 -03:00
Brian Ng e42db35427
Add support for flow inline interfaces (#4543)
Flow commit: 4f93f3adb7

Babel commit: https://github.com/babel/babel/pull/7973

Will follow up w/ flow team on making `InterfaceType` -> `InterfaceTypeAnnotation`, since it seems a bit inconsistent.
2018-05-25 09:17:43 -05:00
Brian Ng 61b39749a1
Add support for flow explicit type arguments (#4540)
Fixes #4489.

Babylon support landed in `beta.48` just now but requires a few other fixture changes, so I'm going to follow this up with another PR.
2018-05-25 08:55:39 -05:00
Lucas Duailibe c2202efd54
Do not remove parens for ?. operator (#4542) 2018-05-24 23:27:49 -03:00
Lucas Duailibe f40b82d183
Fix playground (#4541) 2018-05-24 21:11:12 -03:00
Christopher Chedeau 8f141bfafe
Update babylon & flow (#4536)
* Support new node types for optionals

* Update babylon

* Fix decorator tests

* fix manual errors

* Update flow

* pretty print

* enable option for flow to support ??

* fix AST_COMPARE=1

* fix lint and explicitly test 1_2_3 syntax for flow
2018-05-24 13:06:33 -07:00
Lucas Duailibe ded8524acd
Drop node 4 support for development (#4537) 2018-05-24 15:49:57 -03:00
Lucas Duailibe 52a2a46b3c
New build system (#4449) 2018-05-24 15:30:45 -03:00
Dray Lacy bb6d130b5b Fix printing of `{{{raw}}}` handlebars expressions (#4535)
Previously, `{{{raw}}}` would be output as `{{raw}}`.
2018-05-24 11:16:50 -07:00
Evilebot Tnawi 27b1005455
feat: handle `composer.json` as `package.json` (#4532) 2018-05-24 20:36:16 +03:00
Evilebot Tnawi db0278a186
refactor: math operator (#4529) 2018-05-24 20:19:22 +03:00
James Henry 88b71481fa New: Format Angular Component styles (#4361)
* New: Format Angular Component styles and template

* Clean AST

* Cleanup
2018-05-23 19:08:40 -06:00
Lucas Duailibe 5c6e0802af
Don't default parser to babylon (#4528)
* Don't default parser to babylon

* Different default values according to version

* Fix error logging

* Add tests specifically for parser inference

* Add another test case

* Add API test
2018-05-23 16:55:06 -03:00
Evilebot Tnawi 9db668702c
refactor: `less` extend (#4526) 2018-05-23 19:28:18 +03:00
Evilebot Tnawi 7a8dc82065
refactor: printer (#4501) 2018-05-22 21:10:24 +03:00
Evilebot Tnawi 0b8a8d84f6
fix: scss interpolation in string (#4490) 2018-05-22 16:05:47 +03:00
Jed Fox 9155fe5018
Rename all uses of frontmatter to frontMatter or front-matter (#4519) 2018-05-21 10:02:09 -04:00
Ika 553e9bb1ac
fix(typescript): preserve quoted class property (#4517) 2018-05-21 18:57:30 +08:00
Aakansha Doshi 3fc4c527d3 Add spec for multiple items in class attributes in handle bars (#4509) 2018-05-20 19:53:01 -03:00
Aakansha Doshi 31f79fbc22 Don't add new lines after unless present in graphql (#4512)
* Don't add new lines after unless present in graphql

* fix logic and add more specs

* use index
2018-05-20 13:44:49 -04:00
Lucas Azzola 938d2f06be
Update dependent count in website (#4515)
[155,216](https://github.com/prettier/prettier/network/dependents) now!
2018-05-20 12:58:37 +10:00
Ika a9eb68296c
fix(markdown): do not merge continuous cjk if proseWrap=preserve (#4504)
* test: add tests

* fix(markdown): do not merge continuous cjk if proseWrap=preserve

* fix: remove trailing comma for node4
2018-05-19 13:53:34 +08:00
Lucas Duailibe ea01781d8c
Only break chains with short names if inside ExpressionStatement (#4505) 2018-05-18 21:44:15 -03:00
Lucas Duailibe 1088618b35
Fix wrong test (#4507) 2018-05-18 21:43:54 -03:00
Lucas Duailibe 7d50c25195
Remove unnecessary check for PRETTIER_DEBUG (#4506) 2018-05-18 18:18:12 -03:00
Lucas Duailibe f720cea65f Add --runInBand back to Travis 2018-05-18 15:00:05 -03:00
Lucas Duailibe d0cd112a6f
Store artifacts in CircleCI (#4502) 2018-05-18 12:22:47 -03:00
Jed Fox fa079c33ff
Badge maintenance (#4500)
* Add CircleCI badge to readme

* Improve badge alt text

* Remove unnecessary space

* Disambiguate the two build|passing status badges
2018-05-18 09:46:50 -04:00
Lucas Duailibe b2fa3528b1 Fix CircleCI config 2018-05-18 01:01:09 -03:00
Lucas Duailibe 507e4cd411
Set up CircleCI (#4491) 2018-05-18 00:58:37 -03:00
Joseph Frazier 6d49a224c9
Don't format range if required pragma is missing outside range (#3996)
* Add tests demonstrating --require-pragma behavior with range

* Don't format range if required pragma is missing outside range

Fixes https://github.com/prettier/prettier/issues/3985
2018-05-17 13:38:50 -04:00
Georgii Dolzhykov c6e8177282 Inline AngularJS tests that use `inject` (#4495)
* Inline AngularJS tests that use `inject`

See https://docs.angularjs.org/guide/unit-testing#using-beforeall- for a code example.

* More meaningful function name, minor refactoring

* Linting

* Minor regexp improvement

* address review comments
2018-05-17 12:09:20 -03:00
Evilebot Tnawi a8b0e55205
fix: better output scss maps (#4487) 2018-05-17 13:39:22 +03:00
Suchipi ec45dc9a4c
(refactor): Move common options out of JS plugin (#4445)
* (refactor): Move common options out of JS plugin

* Add Common category to playground
2018-05-15 14:14:50 -06:00
Lucas Duailibe 7bc5ec2dc6
Preserve Liquid tags contents (#4484) 2018-05-15 14:22:41 -03:00
Brian Ng 857c55bd61
Keep parens around do-expressions inside ExpressionStatement (#4479) 2018-05-15 11:41:17 -05:00
Lucas Duailibe 983202413c
Refactor frontmatter handling (#4482) 2018-05-14 22:17:15 -03:00
Evilebot Tnawi 636ae9d037
refactor: `css` language (#4483) 2018-05-15 01:08:04 +03:00
Evilebot Tnawi 9d41f1355a
refactor: parser-postcss (#4478) 2018-05-15 00:00:45 +03:00
Aakansha Doshi f99aee8e46 refactor: use `postcss-values-parser` for `@import` at rule (#4435)
* update to postcss value parser for @import and at rule

* fix specs

* Add rule for @import url and fix specs

* fix more specs

* fix more specs

* import check

* fix specs and add more specs

* remove console.log

* review fixes

* update snapshots

* remove bad code

* fix spec

* remove code

* Add comment

* fix comment

* lint fix
2018-05-14 22:54:34 +03:00
Paco bcdb6936ba Remove unused text parameter from Comments#getSortedChildNodes (#4481) 2018-05-14 14:32:18 -03:00
Nicolò Ribaudo bcfe2257f5 Wrap ?() => T in parens when needed. (#4475) 2018-05-14 11:25:16 -03:00
Ika d0f6aac001
refactor(massageAst): move stripLocation to corresponding plugins (#4477) 2018-05-14 20:52:27 +08:00
Evilebot Tnawi 6cd6ea383e
fix: characters escaping (#4472) 2018-05-14 13:47:46 +03:00
Jed Fox dc68a3d9a6
Break link definitions onto multiple lines when needed (#3531)
* Break link definitions onto multiple lines when needed

* Simplify the conditional for breaking the title

* Don’t print the title if it’s blank

* Revert "Don’t print the title if it’s blank"

This reverts commit 2a8d0dd9995a2e5ab8e6d888c07b88dda058637f.

* Add another test

* Fix title printing

* Second time’s the charm

* Third time’s the charm?

* Fix snapshot

* Prettify

* Don’t break unless `proseWrap` is `always`

* Test `proseWrap: never` on link references
2018-05-14 06:17:37 -04:00
Ika 1062f2a889
feat: support JSON.stringify formatting (#4450)
* test: move tests

* feat: support legacy JSON formatting

* fix: add missing assertion

* test: fix coverage

* fix: same output as JSON.stringify

* refactor: fix linting

* refactor: rename to json-stringify

* refactor: fix linting

* fix: should fix the production build

* docs: remove outdated name

* fix(playgound): add lib/parser-json-stringify.js

* feat(playgound): add example for json-stringify

* fix: no error on singleQuote string

* fix(playground): correctly load json-stringify

* fix: identifier is only allowed in ObjectProperty.key

* refactor: clearer
2018-05-14 09:12:25 +08:00