Commit Graph

17 Commits (3cd1d003c0ae54715301e3838fd1aa64ba576d4a)

Author SHA1 Message Date
Ika e0f74cb94d
fix(javascript): do not attach to block if it's not behind right func paren (#5435) 2018-11-11 00:10:19 +08:00
Jaiden Gerig 0799280429 Fixed unstable comment between function declaration and block statement (#5250) 2018-11-01 21:55:33 +02: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
Aquib Master 3369be0ca2 Fix comment issue with try finally (#5252) 2018-10-12 12:48:49 -04:00
Lucas Duailibe ce952fc8c1
Fix printing of catch clause with a comment (#5202) 2018-10-08 14:18:30 -03:00
Eric Sakmar 93e8b15311 verify the precedingNode type when handling import declaration comments (#5016) 2018-08-27 20:02:40 -06:00
Felix Wu 8779937a07 Bugfix/ Leave Dangle Comments in NewExpression (#5017)
```js
new Thing(/* comment */)
```

now stays the same instead of being formatted into

```js
new Thing /* comment */()
```
2018-08-27 09:23:14 +08:00
Prashant Andani 12cb8a9688 Use destructuring for readability and optimzations at 'for' loop length property… (#4842)
* Use destructuring for readability and optimzations at for loop length property

* Destructure variables for easy maintainability of code

* PR review fix

* refactor: fix linting
2018-07-16 22:39:41 +08:00
Lucas Duailibe b8ded70848 Handle comments in assignments before template literals (#4580)
Closes #4560
2018-05-29 00:08:18 +10:00
Lucas Duailibe 5776c8405a
Fix TSMappedType comments (#4418) 2018-05-05 15:43:53 -03:00
Mike Grip 4c464133ac feat: adding plugin ability for isBlockComment (#4347)
* adding plugin ability for isBlockComment

* refactor to remove private util def

* remove old fn def
2018-04-19 13:31:08 -07:00
Lucas Duailibe 57bc700602
Stop marking all comments in named exports as leading comments (#4292) 2018-04-10 17:05:49 -03:00
Lucas Duailibe f3626611a3
Handle ContinueStatement and BreakStatement comments (#4279) 2018-04-07 13:38:37 -03:00
Lucas Duailibe 85d1e8d1ee wording of the comment 2018-04-05 17:24:42 -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
Mike Grip d9ee183f5b feat: enable plugin-specific comment functionality (#4182)
* feat: enable plugin-specific comment functionality

This change enables language plugins to provide their own "handleComment" function. To do so, we're exposing the addLeadingComment, addTrailingComment, and addDangling comment functions which attach comment nodes correctly in the ast which will get handled by prettier core when printing.

* moving js comment functionality to plugin
2018-03-20 18:39:28 -07:00