Paul Chavard
ca8e049126
fix(glimmer): remove extra space from sub-expressions without params ( #4890 )
2018-07-24 19:50:30 -03:00
Paul Chavard
5d254ce310
fix(glimmer): do not strip block params on <Component> ( #4889 )
2018-07-24 19:07:49 -03:00
Ika
02f64af6e3
fix(vue): no error on range format ( #4868 )
2018-07-22 15:58:29 +08:00
Suchipi
3bfaf6626c
Never inline decorators, unless they're lone parameter decorators ( #4830 )
...
Fixes #2613 .
2018-07-20 13:48:37 -06:00
Ika
1a2c4e663e
chore: use pre-release version number on master ( #4855 )
...
* chore: use pre-release version number on master
* docs: tweak comment
2018-07-18 09:38:26 +08:00
Ika
cb7fe00863
fix(yaml): support end comments ( #4854 )
2018-07-18 09:37:53 +08:00
Ika
ed0ecdad18
fix(json): do not put values on a separate line from the key ( #4852 )
...
* test: add tests
* fix(json): do not put values on a separate line from the key
2018-07-17 18:08:59 -03:00
Eugene Datsky
03ee86ea80
Blacklist this in functional composition heuristics ( #4836 )
2018-07-12 11:58:57 -03:00
Ika
cd16ff27d7
fix(markdown): preserve entity for surrogate pair ( #4832 )
2018-07-12 21:42:39 +08:00
Ika
da91fb2f46
fix(javascript): allow top level super and await ( #4823 )
2018-07-11 13:18:20 +08:00
Ika
2271992446
feat(json): add jsonc to aliases and use it to find parser in markdown embed ( #4734 )
2018-07-07 20:46:34 +08:00
Ika
0df2199688
fix(grahpql): linebreak in non-block stringValue ( #4808 )
2018-07-05 00:14:09 +08:00
Ika
432c9d7d04
feat(yaml): support proseWrap ( #4742 )
...
- support `proseWrap` in `yaml`
- move `proseWrap` to `commonOptions`
- update to `yaml@1.0.0-rc.4` and `yaml-unist-parser@1.0.0-rc.1`
2018-07-04 00:28:47 +08:00
Simen Bekkhus
51b7c02e12
Upgrade jest to 22 ( #4782 )
...
* chore: upgrade Jest
* chore: update snapshots
* chore: lock down babel dependency using invalid syntax
* 2 args to test.skip
* use jest 22 for now
* Revert "2 args to test.skip"
This reverts commit 691fdc3f99e320f2303958f2b503f7b4c93fa455.
* remove snapshot name from matcher
* fix standalone tests skips
2018-07-03 03:06:29 -03:00
Ika
99c4e41fa1
feat: format yaml front matter ( #4773 )
...
* refactor: front-matter
* feat: format yaml front matter
2018-07-03 09:54:40 +08:00
Alexander Kachkaev
a05fd118be
Do not require space after markdown block language name ( #4783 )
...
https://github.com/prettier/prettier/pull/4153 made it possible to detect fenced code block language when it is followed by arguments (e.g. ` ```js {something=something} `). This PR makes it also possible to detect language in cases cases like ` ```js{something=something} ` (no space).
The reason for this change is that Atom highlights code blocks regardless of a space after the language name, which makes users wonder why the correctly detected code block is not being formatted:
<img width="324" alt="screen shot 2018-06-28 at 22 08 13" src="https://user-images.githubusercontent.com/608862/42060780-db11f5b6-7b1f-11e8-9f43-fe91843f7d89.png ">
PR background: https://github.com/prettier/prettier/pull/4153#issuecomment-401174999
2018-07-02 08:22:56 +08:00
Ika
61d5eeadd3
fix(javascript): add parens for await in bind ( #4778 )
2018-06-30 23:15:45 +08:00
Ika
50d242d085
feat(typescript): support TSOptionalType and TSRestType ( #4757 )
...
Ref: Microsoft/TypeScript#24897
2018-06-30 09:10:56 +08:00
Ika
e10c31a333
fix(typescript): update typescript-eslint-parser ( #4762 )
2018-06-29 19:27:21 +08:00
Ika
b67fa907bd
fix(markdown): preserve email autolink ( #4740 )
...
```diff
<hello@example.com>
<mailto:hello@example.com>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-<mailto:hello@example.com>
+<hello@example.com>
<mailto:hello@example.com>
```
2018-06-27 08:36:51 +08:00
Karl O'Keeffe
7a3ac3a693
Handle JSX whitespace separately from fbt whitespace ( #4717 )
...
* Hande JSX whitespace separately from fbt whitespace
* Extra test cases
* Further tweak to JSX handling
* Possible improvement of single character text
* More tests
* Pull out separator code
* More tests for fbt
2018-06-25 19:11:40 +01:00
Ika
f51acf22fe
feat(vue): support pragma ( #4713 )
2018-06-25 10:44:00 +08:00
Ika
c38e6af301
fix(yaml): add missing `since` field ( #4739 )
2018-06-23 17:04:47 +08:00
Suchipi
cb5e1db4a5
Revert "Ternary Operators in JSX Expression Containers ( #4731 )" ( #4736 )
...
This reverts commit 12046cd01b
.
2018-06-22 10:32:38 -06:00
tyrerexus
12046cd01b
Ternary Operators in JSX Expression Containers ( #4731 )
...
This pull request aims to fix the issue of excessive nesting brought up in the following comment: https://github.com/prettier/prettier/issues/737#issuecomment-392541493
This "fix" is very simple. It adds a new possible way to activate JSX mode for ternary operators. If the first non-conditional parent of the expression is a JSX expression container, then JSX mode gets activated.
This branch also contains a test case for said scenario.
2018-06-22 10:30:53 -06:00
David Gomes
9e0b1223cd
Update postcss-scss parser version to 1.0.6 (with test for it). ( #4733 )
2018-06-22 13:42:15 +03:00
Rubén Norte
cbef0105e9
Upgrade flow-parser to 0.75.0 ( #4727 )
...
* Upgrade flow-parser to 0.75.0
* Added failing test for optional catch binding and flow-parser@0.74.0
2018-06-21 10:50:54 -07:00
Ika
dcf44ffbdc
feat: support YAML ( #4563 )
...
* feat: support YAML
* fix: do not indent sequence in mappingValue
* docs: add yaml to index.md
* fix: reduce `SyntaxError: Node#parse consumed no characters`
* chore: remove old-build and new-worker.js
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* refactor
* fix: no space after `<<`
* fix: add yaml to standalone test
* test: add tests
* fix: next empty line in flow collection
* fix: tabs are not allowed
http://yaml.org/spec/1.2/spec.html#space/indentation/
* fix: update parser
* feat: rewrite the mappingItem logic
* feat: indent sequence in mapping
* feat(doc): add ifBreak#groupId and group#id
* chore: fix node 4
* chore: add tools_yaml.svg
* chore: remove resolved TODO
* refactor: remove unnecessary workaround
* chore(worker): importScriptOnce
* chore(build): rename with babelPlugins
* make it rollup compatible
* feat: support singleQuote
* refactor
2018-06-21 10:29:42 +08:00
Ika
b99de9811b
feat(graphql): support pragma ( #4699 )
2018-06-17 14:04:48 +08:00
Ika
4109abf4dd
feat(javascript): support BigIntLiteral ( #4697 )
2018-06-16 00:20:04 +08:00
Evilebot Tnawi
03a2002348
fix: newline between front-matter and comment ( #4701 )
2018-06-15 16:27:41 +03:00
Vojtěch Štěpančík
56af3d621d
Add support for parsing babylons throwExpressions ( #4695 )
2018-06-14 21:35:39 -03:00
Ika
f6890bd071
feat(css): support pragma ( #4688 )
2018-06-14 09:51:18 +08:00
Ika
5646573ad7
fix(javascript): preserve parens for type casting for sub-item ( #4648 )
2018-06-11 19:50:53 +08:00
Lynn Smeria
61d35dd636
fix(typescript): preserve type parameters of import-types ( #4656 ) ( #4662 )
2018-06-11 11:29:10 +10:00
Ika
98bfd03d93
feat(typescript): support unknown type ( #4625 )
2018-06-10 00:12:30 +08:00
Lucas Duailibe
d013983d8a
Always expand first argument if the second argument is also a call expression ( #4657 )
2018-06-08 15:16:12 -03:00
Lucas Duailibe
cb1c52ad08
Break JSX in arrow functions in JSX expressions ( #4601 )
2018-06-08 15:15:50 -03:00
Ika
35a42bef24
fix(markdown): better handling for trailing spaces ( #4593 )
...
- preserve trailing spaces in html, excluding html comment
- `doc-printer` is now unrelated to `options.parser`
- fix some cases that two trailing spaces are mis-considered as `break`
2018-06-08 00:20:25 +08:00
Aakansha Doshi
8ec5432768
Fix empty file error in json and graphql ( #4553 )
...
* Fix empty file error in json and graphql
* fix AST_COMPARE=1 issue
* use tests/empty
* revert
* fix lint
2018-06-06 10:41:12 -03:00
Ika
f27f6c525b
fix(typescript): preserve decorator on interface ( #4632 )
2018-06-05 00:08:24 +08:00
Lucas Duailibe
a4da6e6c8e
Inline _ or $ in the root of a method chain ( #4621 )
2018-06-01 12:51:06 -03:00
Ika
b55997eb3d
fix(multiparser): no additional trailing newline for graphql in js ( #4616 )
...
Fixes #4615
The root cause is the output doc from graphql printer does not match the desired input from `stripTrailingHardline`.
a9b21a01e2/src/doc/doc-utils.js (L167-L180)
2018-06-01 00:38:39 +08:00
Ika
e74e6565b4
fix(markdown): respect blank line between block htmls ( #4609 )
...
Fixes #4605
The AST here is actually two `html`s and it did follow the [CommonMark spec](https://spec.commonmark.org/0.28/#html-blocks ), so I ended up with respecting the blank line between block `html`s.
2018-06-01 00:33:37 +08:00
Evilebot Tnawi
9387e9d833
fix: comment type for scss ( #4598 )
2018-05-30 23:22:18 +03:00
Ika
8abbc5d4b0
fix(javascript): regression for `hasOwnProperty` ( #4603 )
2018-05-31 00:39:39 +08:00
Evilebot Tnawi
3d60871458
fix: output color adjusters ( #4494 )
2018-05-29 15:24:38 +03:00
Lucas Duailibe
b8ded70848
Handle comments in assignments before template literals ( #4580 )
...
Closes #4560
2018-05-29 00:08:18 +10:00
Lucas Duailibe
a6db391556
Short rule should only apply to the first identifier ( #4575 )
2018-05-27 21:52:42 -03:00
Kevin Donnelly
16a84e88d6
Improve format when passing ts arrow function with return type as an argument ( #4228 )
...
* Add various tests for ts type annotated function properties.
* Improve format when passing ts arrow function with return type
* Add test for case from #2581 .
2018-05-27 20:39:08 -03:00
Jed Fox
a1e8d586ad
Add a single test suite for blank files in all parsers ( #4562 )
...
* Add a single test suite for blank files in all parsers
The parsers that don’t yet support blank files have been filtered out of the list until they do.
* Don’t directly `require()` Prettier
* Update `require`
* Add missing Babylon parser
* Update snapshots
2018-05-27 08:22:25 -04:00
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
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
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
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
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
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
0b8a8d84f6
fix: scss interpolation in string ( #4490 )
2018-05-22 16:05:47 +03: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
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
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
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
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
Nicolò Ribaudo
bcfe2257f5
Wrap ?() => T in parens when needed. ( #4475 )
2018-05-14 11:25:16 -03: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
Evilebot Tnawi
bc2f57dcf9
fix: css variables and scss interpolation ( #4471 )
2018-05-12 22:38:28 +03:00
Elias Meire
2f5c00ad18
Fix: not greedy match the frontmatter in postcss parser ( #4457 )
2018-05-10 13:50:19 -03:00
Ika
6447d30b0b
feat(markdown): change unordered list symbol to hyphen ( #4440 )
2018-05-10 14:32:52 +08:00
Soo Jae Hwang
ee96e97c77
Fix: Group long name method in bind expressions ( #4447 )
...
* Fix: Group long name method in bind expressions
* Add test for short name method in bind expressions
2018-05-09 10:42:16 -06:00
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
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
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
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
e3223fe9af
Prevent flattening multiplicative operations ( #4407 )
2018-05-02 23:48:40 +02: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
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
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
Evilebot Tnawi
58a91cc570
feat: improve `@support` at-rule output ( #4372 )
2018-04-25 20:41:41 +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
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
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
Brian Ng
7cb6790ce0
Merge pull request #4326 from existentialism/flow70
...
Bump flow to 0.70
2018-04-18 17:04:14 -05:00
Aakansha Doshi
7f20ffc7f5
Allow trailing comma in scss list and maps ( #4317 )
...
* Allow trailing comma in scss list and maps
* fix #4076
* triple equalto
* newline
* linting
* review fixes
* print trailing comma only when options.tralingComma is not none
* Add nested maps and lists
* add isSCSS() check
* linting
* Add utils for isSCSS() in language-css
* lint
2018-04-18 17:40:01 -03:00
Brian Ng
7ab3e94fbb
Ensure mixins before implements
2018-04-16 21:28:56 -05:00
Brian Ng
e22ec0b9b9
Bump flow to 0.70
2018-04-16 20:53:07 -05:00
Christopher Chedeau
02a1db8c9f
[flow] Fix union indent inside of function param with a name ( #4325 )
...
Fixes #4323
See #4323 for all the context
2018-04-16 18:47:05 -07:00
Zach Gawlik
0a22f5ec15
Wrap awaits in unary expressions ( #4315 )
2018-04-14 15:27:18 -04:00
Evilebot Tnawi
7c0dee617b
refactor: `parseNestedCSS` function ( #4208 )
2018-04-13 22:12:59 +03:00
Evilebot Tnawi
47cb5ad298
fix: correct prettier placeholder regex ( #4302 )
2018-04-12 18:25:25 +03:00
Jed Fox
63a2ded4c9
Never print a semicolon after `export default interface Foo {}` ( #4128 )
...
* Never print a semicolon after `export default interface Foo {}`
* Add test
2018-04-11 06:38:02 -04:00
Christopher Chedeau
7819a8f010
[flow] Upgrade flow to 0.69 and enable ?. support ( #4296 )
...
Flow now support ?. so this PR enables it in prettier
2018-04-10 18:03:34 -07:00
Lucas Duailibe
57bc700602
Stop marking all comments in named exports as leading comments ( #4292 )
2018-04-10 17:05:49 -03:00
Aakansha Doshi
6794a14554
Inline Angular async tests and beforeEach, etc. ( #4241 )
...
* fix #3791 and refactor isTestCall
* typo
* remove default value
* add safe check if parent exists
* add spec
* better comment
2018-04-11 00:06:42 +08:00
Ika
c052d9c086
test(markdown): update snapshot ( #4283 )
2018-04-09 08:20:29 +08:00
Nate Pendleton
28e4b07b17
fix(issue-3982): Glimmer printer now properly handles else-if blocks without else block … ( #4256 )
...
* fix(glimmer): Now properly handles else-if blocks without else block and block statements as root of else.
* run prettier on printer-glimmer.js
2018-04-08 11:36:37 -06:00
Ika
0c1d62079e
feat(markdown): support hasPragma/insertPragma ( #4275 )
...
* feat(markdown): support hasPragma/insertPragma
* test: add require-pragma tests
* feat: support pragma with front matter
* feat: support pragma in multiline comment
2018-04-09 00:10:24 +08:00
Lucas Duailibe
f3626611a3
Handle ContinueStatement and BreakStatement comments ( #4279 )
2018-04-07 13:38:37 -03:00
Ika
4bc80d8c64
fix(markdown): remove unnecessary empty line in front matter ( #4280 )
...
* test: add tests
* fix(markdown): remove unnecessary empty line in front matter
2018-04-08 00:05:27 +08:00
Lucas Duailibe
a92838facf
Prevent formatting GraphQL embedded in JS if it contains invalid escape sequences ( #4278 )
2018-04-07 12:03:56 -03:00
Lucas Duailibe
18aaee594f
Break object destructuring with nested destructuring ( #4267 )
2018-04-06 11:57:37 -03:00
Lucas Duailibe
2e73164b81
Fix embedded GraphQL in JS with backticks ( #4265 )
2018-04-05 17:52:09 -03:00
Lucas Duailibe
fa089f5bb6
If consequent is a block statement, treat as trailing comment
2018-04-05 17:22:10 -03:00
Lucas Duailibe
88489a9afe
Handle comments before `else`
2018-04-05 16:06:18 -03:00
Lucas Duailibe
e17bb5e947
Break nested ternaries ( #4120 )
2018-04-04 18:50:15 -06:00
Alexander Ryzhikov
6d7bc4402f
fix: don't lowercase custom selectors variable name #4254 ( #4255 )
...
* fix: don't lowercase custom selectors variable name #4254
* proper fix for camelCased custom selector
* Move customs-selectors case snapshots to correct place
2018-04-04 15:19:51 +03:00
Evilebot Tnawi
c9bb96cd52
fix: don't break value property with inlined URL ( #4236 )
2018-04-02 14:16:39 +03:00
Evilebot Tnawi
f2f2390114
fix: inline comments in lists and maps ( #4205 )
2018-03-31 17:18:23 +03:00
Evilebot Tnawi
30bcd110e4
fix: mangles template literal when you use `prettier-ignore` ( #4220 )
2018-03-30 21:40:14 +03:00
Rui Araújo
9da8752585
Allow new interface style for GraphQL. ( #4012 )
...
* Allow new interface style for GraphQL.
This is a breaking change since it will upgrade the old style to the new one.
Closes #3600 .
* Allow old interface style.
When in present of mixed style, it updates to the new one.
2018-03-27 00:52:57 -06:00
Ika
1b09fde361
feat(markdown): support top-level `prettier-ignore-start/end` ( #4202 )
...
* test: add tests
* feat(markdown): support top-level `prettier-ignore-start/end`
* docs(ignore): add range ignore
2018-03-27 00:03:28 +08:00
Jeff Lau
24f45d1b50
Require parenthesis around "TSAsExpression" inside an "UpdateExpression" ( #4183 )
2018-03-21 11:38:10 -03:00
Brian Ng
4553b88bd4
Merge pull request #4156 from Cryrivers/master
...
feat(typescript): support TSMinusToken and TSPlusToken
2018-03-21 09:06:06 -05:00
Evilebot Tnawi
190d34fa46
tests: comments with `CRLF` ( #4145 )
2018-03-21 12:04:57 +03:00
Evilebot Tnawi
31530259a1
feat: indent in discriminant switch ( #4165 )
2018-03-19 23:50:24 +11:00
Wang Zhongliang
5eea8aa2f5
feat(typescript): support TSPlusToken
2018-03-16 14:08:25 +08:00
Wang Zhongliang
67277f7477
feat(typescript): support TSMinusToken
2018-03-16 10:46:12 +08:00
Ika
0c09e150ba
feat(markdown): support fenced codeblock lang followed by attributes ( #4153 )
...
* test: add tests
* feat(markdown): support fenced codeblock lang followed by attributes
ref: https://shd101wyy.github.io/markdown-preview-enhanced/#/code-chunk
* refactor: set limit
2018-03-16 00:25:39 +08:00
Evilebot Tnawi
5537140296
fix: don't lowercase variable in css modules ( #4152 )
2018-03-15 18:16:28 +03:00
Evilebot Tnawi
e2373206bc
fix(html): support comment on top ( #4141 )
2018-03-13 19:47:48 +03:00
Evilebot Tnawi
8686653433
tests(html): aurelia non standard attributes ( #4142 )
2018-03-13 19:03:44 +03:00
Lucas Duailibe
13103101eb
Move pragma detection/insertion to plugins ( #3685 )
...
New pragma infrastructure, only JS and JSON has detection/insertion implemented
2018-03-08 13:50:33 -03:00