Commit Graph
2371 Commits
Author SHA1 Message Date
tjallingt 8cf591447c Added support for the graph ql comment tag (#4395)
* Added support for the graph ql comment tag

As described in the issue https://github.com/prettier/prettier/issues/4360
Prettier still adds a space inbetween the comment tag and the template literal.

* Added comment explaining the random spaces around GraphQL

* Fixed failing AST_COMPARE tests
2018-05-09 01:52:35 -06:00
Nicolò Ribaudo ab452ddc38 Fix: Correctly break class prperties initializer. (#4442) 2018-05-08 20:35:49 -04:00
Lucas Duailibe ef932741ad Add concurrently to website yarn start (#4441) 2018-05-08 16:53:49 -03:00
Ika 3fe790d4b7 refactor: fix linting 2018-05-08 12:42:02 +08:00
Ika 76a5f3c7b6 fix(typescript): add missing qualifier and typeof in TSImportType (#4438) 2018-05-08 12:35:12 +08:00
Kevin Donnelly c6e7c1966e Improve formatting of TS casts with generics and unions (#4219)
* Add tests showing existing behavior of various TS casts.

* Improve formatting of TS casts with generics and unions.

By adding a soft break between the cast and the expression. Also
includes wrapping parentheses for clarity as suggested in #4171.

Avoids changing behavior at all though if casting an array or object
literal because those already have good behavior where the array or
object literal breaks before the cast does so including them would just
result in a pointless extra layer of parentheses that would add no
clarity.

* Update tests in prepation for updating long cast format.

* Update so nested breaks inside type cast are indented.

* Add tests where expression being cast is too long itself.

* Update cast formatting to only sometimes break after cast.

Specifically it will break after the cast if that makes the cast itself
fit on a single line. If the cast itself won't fit on a single line then
the expression being cast will be placed directly after the `>` at the
end of the cast.
2018-05-07 22:26:01 -06:00
Suchipi ed18f9f7d7 Add heuristic to format functional composition more nicely (#4431)
* Add heuristic to format functional composition more nicely

* Regex -> array

* Use object instead of array for faster lookup

* Remove empty lines

* Add redux connect

Also add comments for libraries
2018-05-07 21:46:30 -06:00
Ika df3eb0cf68 refactor(massageAst): move target props to corresponding plugins (#4430) 2018-05-08 10:48:29 +08:00
Alexander Kachkaev 218abba141 Add /coverage/ to .eslintignore (#4436) 2018-05-07 14:07:48 -03:00
Lucas Duailibe f6b22e3fd1 feat: support styled-components Foo.extend.attrs()`` (#4434)
* Support styled-components Foo.extend.attrs()``

* update snapshot
2018-05-07 12:38:19 +03:00
Ika cc4392e5c0 feat(typescript): support TSImportType (#4429)
* feat(typescript): support TSImportType

* test: add singleQuote test
2018-05-07 07:57:57 +08:00
Aakansha Doshi 299cc97ceb Fix spacing issue in postcss simple vars (#4408) 2018-05-06 13:51:28 +02:00
Ika 7e81a613b5 feat(javascript): support jest-each template string (#4423)
* feat(javascript): support jest-each

* test: add trailing newline

* fix: there can be no trailing newline

* refactor: simplify regex

* refactor: Array.from

* refactor

* fix: print quasis safely
2018-05-06 14:52:34 +08:00
Lucas Duailibe 5776c8405a Fix TSMappedType comments (#4418) 2018-05-05 15:43:53 -03:00
Johann Hubert Sonntagbauer 1a6cf3d071 revert changes to code mirror gutter styles (#4419) 2018-05-04 13:31:53 -03:00
Lucas Duailibe 8e1b60e943 Fix trailing JSDoc comments with trailing regular comments (#4414) 2018-05-04 10:15:30 -03:00
Lucas Duailibe bafa76f613 Wrap modulo operation in parens inside additive operation (#4413) 2018-05-03 12:28:37 -03:00
Lucas Duailibe c77f1e5987 [playground] Fix doc debug 2018-05-03 10:12:06 -03:00
Lucas Duailibe e3223fe9af Prevent flattening multiplicative operations (#4407) 2018-05-02 23:48:40 +02:00
Lucas Duailibe 6ceba37f9f Add miniprettier to website and docs (#4411) 2018-05-02 12:51:28 -03:00
Lucas Duailibe 32900842e3 Apply destructuring rules in functions to catch param (#4385) 2018-05-01 10:24:46 -03:00
David Sheldrick d77f5e9c3a Fix cursor offset tracking (#4397)
* handle cusor position relative to comments correctly

* use more robust method of cursor offset tracking

* add support for cursorOffset with rangeStart/End

* add tests for cursorOffset

* use old JS syntax for node4

* add another cursor offset test case

* remove trailing whitespace in cursor tests

* fix null findNodeAtOffset handling

* remove dead code

* add more test cases

* use indexOf for node4

* revert comments.js

* add more comment tests

* change tests infra

* Fix AST_COMPARE

* move CURSOR to top level of file

* mutate result

* use es6 property shorthand

* simplify diff offset calculation

* put remaining test cases in individual files
2018-05-01 09:42:59 -03:00
Johann Hubert Sonntagbauer 3a99fe5d65 [playground] fix overflow in safari (#4406)
* [playground] fix overflow in safari

* options panel will not outgrow editors panel

* fix overflow in safari 10.1

* fix odd code mirror gutter placement during overflow
2018-05-01 09:41:25 -03:00
Johann Hubert Sonntagbauer 1e69119354 [playground Prevent overflow in Firefox (#4394) 2018-04-28 17:38:22 -03:00
Elias Meire 5b7ebb18ba Fix: Always preserve frontmatter, remove dependency (#4392)
* Fix: Always preserve frontmatter, remove dependency

* Move correct test to correct filename

* Add test for malformed frontmatter, finetune regex

* Use other malformed test case

* Update yarn.lock
2018-04-28 08:53:30 -03:00
Nate Pendleton 91c701886d fix(glimmer): preserve leading/trailing spaces in text nodes undernea… (#4288)
* fix(glimmer): preserve leading/trailing spaces in text nodes underneath attribute nodes when next to mustache statements.

* fix(glimmer): format printer-glimmer.js

* fix(glimmer): lint fix

* fix(glimmer): removed decomposition assignments to be compatible with Node 4

* fix(glimmer): Array.includes() -> indexOf() for Node 4
2018-04-27 14:20:10 -06:00
Huy Vo 2ad7576d3a Remove newline in empty .md files (#4388)
* Remove newline in empty .md files

* Fix cannot read property 'type' of undefined bug
2018-04-27 15:01:14 +08:00
Lucas Duailibe 8015e417c0 Separate entry for web bundle (#4386) 2018-04-26 13:38:57 -03:00
Ika 9cc5d4f162 fix(json): jsonc is considered JSON instead of JSON5 (#4374)
* fix(json): jsonc in consider JSON instead of JSON5

* feat: add json5 id
2018-04-27 00:09:36 +08:00
Jed Fox c37861d08b Add a redirects file (#4321)
* Add a redirects file

* Remove non-working redirects
2018-04-26 11:41:52 -04:00
Evilebot Tnawi 2fe5263ff9 refactor: printer-postcss (#4378) 2018-04-26 13:53:52 +03:00
Ika ff38aaff95 fix(javascript): correct escape for markdown in js (#4381)
* test: add tests

* fix(javascript): correct escape for markdown in js

* test: add trailing newline
2018-04-26 13:22:43 +03:00
Ika b46a46b112 fix(playground): add missing input code sample for copy markdown (#4382) 2018-04-26 00:37:29 -03:00
Kostas Bariotis 9d5a7c7c66 Edit metrics as seen at NPM/GitHub network (#4379) 2018-04-26 10:54:45 +08:00
Lipis 37eea26acf Make Travis green again (#4380) 2018-04-26 10:17:19 +08:00
Evilebot Tnawi 2a3c616787 refactor: remove unused css-import node (#4375) 2018-04-25 21:29:59 +03:00
Evilebot Tnawi e5741552ed feat: use postcss-values-parser for @namespace at rule (#4373) 2018-04-25 21:27:12 +03:00
Evilebot Tnawi 58a91cc570 feat: improve @support at-rule output (#4372) 2018-04-25 20:41:41 +03:00
Lucas Duailibe 67f1c4877e Refactoring: better boundaries for different parts of the project (#4364) 2018-04-25 13:29:35 -03:00
Ika 289b98c125 feat(json): enforce StringLiteral-style property key (#4371)
* test: add tests

* feat(json): enforce StringLiteral-style property key
2018-04-26 00:00:07 +08:00
Ika 317f3a3c56 feat: split out JSON5 (#4367)
* feat: split out JSON5

* test: update snapshots

* test: update debug-check tests

* feat(playground): use JSON's code sample for JSON5

* fix: add missing trailing newline
2018-04-25 22:10:22 +08:00
Ika 6b2be99b53 docs(plugins): add parser.preprocess (#4365)
* docs(plugins): add parser.preprocess

* docs: fix linting
2018-04-25 00:41:39 +08:00
Ika 6a17474e37 feat(typescript): support generic JSX element (#4268)
* feat(typescript): support generic JSX element

* fix(playground): `buffer is not defined` in `--parser typescript`

* chore(deps): update typescript-eslint-parser
2018-04-24 08:45:31 -05:00
Ika 643e2a83d6 feat(typescript): support TaggedTemplateExpression typeParameters (#4353)
* test: add tests

* feat(typescript): support TaggedTemplateExpression typeParameters

* fix(playground): `buffer is not defined` in `--parser typescript`

* chore(deps): update typescript-eslint-parser
2018-04-24 08:45:06 -05:00
Lucas Duailibe 50101e98c6 Fix pragma detection/insertion for JSON (#4333) 2018-04-24 10:10:16 -03:00
Ika 586b55b326 docs(api): language.since is now optional (#4363) 2018-04-24 21:00:52 +08:00
Adam Pearce 09ac476a32 Nicer line wrapping for d3 (#4285)
* d3 counts as a constructor

* adds test

* Tweak wording

* docs: fix linting

* updates test

* no $ special case

* renames function

* shorter function name

* removes trailing white space
2018-04-24 06:54:45 -04:00
Vlad Korobov 80196b6553 Metric.ai users (#4358)
* Metric.ai logo added

* Metric.ai users data added

* style: remove extra trailing newline
2018-04-23 22:59:30 +08:00
Lucas Duailibe 3bc9b68cf6 Remove old playground files 2018-04-20 12:10:32 -03:00
Lucas Duailibe 091edee99c New playground (#3573) 2018-04-20 12:08:05 -03:00