Commit Graph

1204 Commits (0410949984a1a4c99d3b56b95123d70951b197c8)

Author SHA1 Message Date
James Henry 0410949984 Lock tsep to specific commit (#2152) 2017-06-15 22:45:38 +10:00
Lucas Azzola 9e7b02d50e Print {} in import if it's in the source, fixes #2145 (#2150) 2017-06-15 20:19:01 +10:00
Joseph Frazier cb44125a21 Let `prettier --stdin` work with keyboard input (#2147)
This uses [get-stream] instead of [get-stdin], since the latter just
gives an empty string if process.stdin is a TTY
(see https://github.com/sindresorhus/get-stdin/issues/21)

[get-stream]: https://github.com/sindresorhus/get-stream
[get-stdin]: https://github.com/sindresorhus/get-stdin
2017-06-15 09:57:29 +10:00
Joseph Frazier 3bbfa97152 Check exit codes in integration tests (#2148) 2017-06-15 09:56:48 +10:00
Lucas Azzola a2328edced TypeScript: keep parens around with yield/await non-null assertion, fixes #2137 (#2149) 2017-06-15 09:34:12 +10:00
James Henry 3726067923 Override tsep loggerFn with noop (#2144)
* Override tsep loggerFn with noop

* Extra function to keep Vjeux happy :P
2017-06-14 14:53:05 -07:00
Joseph Frazier f361910036 Upgrade dependencies (#2140)
Among other things, this upgrades fsevents from 1.1.1 to 1.1.2, which
eliminates a `yarn` warning on OSX machines running Node.js 8. See here
for details: https://github.com/strongloop/fsevents/issues/170
2017-06-14 14:29:35 -07:00
Joseph Frazier 48bbd9cb6b Don't insert a cursor placeholder for a value-less path (#2136)
* Test that no cursor placeholder is inserted for a value-less path

This was taken from https://github.com/prettier/prettier/issues/2131

* Don't insert a cursor placeholder for a value-less path

This fixes https://github.com/prettier/prettier/issues/2131
2017-06-14 09:05:06 -07:00
Lucas Azzola b7e1c366e0 Vue: pretty-print binding syntax (#2108)
* feat(vue): pretty-print :class attributes

* feat(vue): switch to brand new custom parser API! 🎉

* refactor(vue): move AST manipulation to post-parse
2017-06-14 22:33:15 +10:00
James Henry 9b772cb4fd Add test for comment in TypeScript type parameters (#2132) 2017-06-14 20:10:03 +10:00
George Chung 68550450b6 Typo fix (#2134) 2017-06-14 20:08:32 +10:00
Christopher Chedeau abfdbe1896 Upgrade typescript to 2.4 (#2120)
Fixes #2117
2017-06-13 09:47:40 -07:00
Rodrigo Pombo 8dd0cb2a05 Format CSS in template literals with expressions (#2102)
* Add support for styled-jsx with expressions

* Lint

* Fix require for Node 4

* Re-create template-literal document when replacing placeholders

* Add support for styled-components with expressions

* Fix merge

* Move css library detection to functions
2017-06-13 09:45:16 -07:00
Lucas Azzola 40c41f232f Website: usability improvements (#2118)
* feat(website): use worker thread for formatting

* Create index.html

Remove step=5
2017-06-13 09:20:13 -07:00
Christopher Chedeau e69d0fe5fb Create why-prettier.md 2017-06-12 21:00:04 -07:00
Christopher Chedeau 0877612e68 Create README.md 2017-06-12 20:00:42 -07:00
Lucas Azzola d274e24e23 docs(readme): add "styled with prettier" badge 2017-06-13 10:45:08 +10:00
adanoff 44b5da8ade Add `graphql.experimental` parsing for react-relay (#2116) 2017-06-12 17:16:17 -07:00
Cody Zuschlag 4cf94c95c7 add list of projects using prettier (#2104)
* doc(readme): add project logos using prettier

* doc(readme): link to npm dependents

* doc(readme): footnote for projects using prettier
2017-06-12 14:23:33 -07:00
Christopher Chedeau 62b9e29af5 Fix comments in non strict mode (#2114)
It turns out that by returning there, we didn't go through the line `delete ast.tokens` and the comments attachment logic would attach it to a random token. It's great that this fail-safe caught this bug!

Fixes #2111
2017-06-12 09:50:51 -07:00
Lucas Azzola fbf9064090 refactor(multiparser): move some logic from printer.js to multiparser.js (#2109) 2017-06-12 08:06:41 -07:00
Lucas Azzola 4e4922b428 feat(website): revamp the website a bit (#2113) 2017-06-12 07:58:06 -07:00
Alex Ilyaev 85b7ec2b7f WebStorm: Uncheck Immediate file synchronization (#2112)
In WebStorm file watcher, it doesn't make sense to reformat with Immediate file synchronization since the code jumps around while you type and if you sneak in a character while reformatting WebStorm pops a conflict alert.

So it's much saner to reformat on Save only.
2017-06-12 22:45:35 +10:00
Lucas Azzola 364c38de0d Implement custom parser API (#1783)
* feat(api): add custom parser API

* test(api): add integration test for parser resolution

* chore(api): fix build after resolving conflicts

* docs(api): document custom parser API

* docs(api): fix typo

* chore(build): add parse5 to build and support yarn test --prod
2017-06-12 16:51:12 +10:00
Lucas Azzola 486a89bfdc fix(typescript): workaround - don't wrap directives in parens, fixes #2074 (#2107) 2017-06-11 19:10:56 -07:00
Lucas Azzola e8f12cf621 TypeScript: Remove parens from type annotations where possible (#2098)
* fix(typescript): remove parens from union types where possible, fixes #1885

* fix(typescript): ensure parenthesis removal is stable

* fix(typescript): don't strip parens around function type
2017-06-11 18:06:47 -07:00
Lucas Azzola 9c608d2ec1 fix(typescript): use printFunctionParams for call/construct signature, fixes #2105 (#2106) 2017-06-11 16:06:38 -07:00
Jonas Gierer 2dba2a64da Add `prettier-github` to related projects 2017-06-11 18:59:29 +02:00
Lucas Azzola ec7d99439d fix(typescript): print arrow function type params on same line as params, fixes #2099 (#2101) 2017-06-11 07:30:51 -07:00
Lucas Azzola 026f9b4de7 docs: prune old vim links from the table of contents 2017-06-11 22:35:35 +10:00
Lucas Azzola 4395e09b78 fix(import): allow break with both default named import, fixes #2050 (#2096) 2017-06-10 21:55:21 -07:00
Lucas Azzola a79a444bac fix(variable-declarator): indent first variable in one-var scenario, fixes #2072 (#2095) 2017-06-10 21:19:50 -07:00
Lucas Azzola fdb7467de7 feat(html): add support for HTML fragments (#2093) 2017-06-10 20:10:34 -07:00
Lucas Azzola b4f0ff346e feat(mutliparser): add react-relay and graphql-tag parsing (#2092) 2017-06-10 08:59:27 -07:00
Lucas Azzola d1b94c540c Implement parser switching (HTML, Vue, styled-components) (#2086)
* feat(multiparser): implement switching from html -> css,js,ts

* feat(multiparser): use quasi value instead of originalText
2017-06-10 08:03:39 -07:00
Lucas Azzola 77f0c05d2a fix(method-chain): break on non-literal computed member expression, fixes #2075 (#2087) 2017-06-10 07:47:22 -07:00
Lucas Azzola 1e08f03554 fix(typescript): break on multiple interface extends, fixes #2043 (#2085) 2017-06-10 07:46:59 -07:00
Lucas Azzola f7819d5695 CSS: implement prettier-ignore (#2089)
* fix(css): implement prettier-ignore, fixes #2007

* refactor(css): move prettier-ignore to printNodeSequence
2017-06-10 07:45:59 -07:00
Lucas Azzola a9409f11e7 fix(css): print @else on same line as }, fixes #2053 (#2088) 2017-06-10 07:40:05 -07:00
Lucas Azzola 8903e5e527 fix(html): fix AST_COMPARE on htmlparser2 ASTs (#2084) 2017-06-09 19:45:39 -07:00
Lucas Azzola d00956d51d feat(html): add parse5/htmlparser2 printer (#2083) 2017-06-09 19:22:59 -07:00
Christopher Chedeau f399e90bc2 Preserve lines after directives (#2070)
Looks like we were only doing it at the top level, we should do it everywhere.

Fixes #2067
2017-06-08 17:10:01 -07:00
Christopher Chedeau d062961ccf Create README.md 2017-06-08 16:57:26 -07:00
Mitermayer Reis 7114eb4f1e Fixing type on vim documentation (#2066)
* Adding --stdin-filepath option in order to enable filetype inference from
stdin

* Fixing typo on the documentation
2017-06-08 14:37:02 -07:00
Christopher Chedeau 939734b75e Use ifBreak instead of shouldBreak (#2063)
shouldBreak is only a heuristic to enforce a break, if it breaks "naturally", then it won't be applied.

Fixes #2055
2017-06-08 11:47:49 -07:00
Tim Griesser 753ff5f0ac Fix lint errors (#2062) 2017-06-08 09:49:24 -07:00
Mitermayer Reis 8a87681f66 Adding vim editor reference (#2041)
* Adding --stdin-filepath option in order to enable filetype inference from
stdin

* Creating vim editor integration docs

- Moving vim editor integration into editors directory
- Adding information about vim-prettier
2017-06-08 09:43:27 -07:00
Tim Griesser df26cc05cc Support graphql ListType (#2061) 2017-06-08 09:34:35 -07:00
Christopher Chedeau 883e637fa9 Support the Keyword type (#2056)
This is an issue in https://github.com/eslint/typescript-eslint-parser/issues/315

Fixes #2049
2017-06-08 09:25:28 -07:00
Tim Griesser e9045e4bcf Support graphql NonNullType (#2060) 2017-06-08 09:20:41 -07:00