Commit Graph

31 Commits (952bc0cc039c034c5fe651864db528dcd9800e9e)

Author SHA1 Message Date
Ika 952bc0cc03
fix: get rid of CRLF (#5494) 2018-12-08 18:28:29 +08:00
Ika 3a5bbf5fd2
fix(typescript): do not change `module` into `namespace` and break/hug their body correctly (#5551) 2018-11-26 13:34:35 +08:00
Ika 4af3dd4b07
test: improve snapshots (#5521)
- before
  ```
  ${input}${"~".repeat(printWidth)}
  ${output}
  ```
- after
  ```
  ===options===
  ${options}
  ${" ".repeat(printWidth)}| printWidth
  ====input====
  ${input}
  ===output====
  ${output}
  =============
  ```
2018-11-25 16:21:14 +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 98bfd03d93
feat(typescript): support unknown type (#4625) 2018-06-10 00:12:30 +08:00
Zach Gawlik 0a22f5ec15 Wrap awaits in unary expressions (#4315) 2018-04-14 15:27:18 -04:00
James Henry 5feb76f13f Update tsep to v11 and update snapshot (#3471)
* Update tsep to v11 and update snapshot

* Remove unneeded TSNamespaceFunctionDeclaration
2017-12-14 17:44:59 +11:00
Lucas Duailibe f119d4a90f
Change run_spec to have explicit parser list (#3356) 2017-11-30 03:31:52 -03:00
Anton a0c95cf862 UTF8-BOM - if input string has BOM that mean output string also should have it (#3283)
The issue that prettier lost BOM and mean convert UTF-8 with BOM to just UTF-8
2017-11-21 14:38:21 -07:00
Lucas Azzola 7e60d70f97 fix(typescript): always break interfaces onto multiple lines, fixes #2159 (#2161) 2017-06-15 14:34:54 -10:00
Christopher Chedeau 0d239477cb Use semi-colon for object separator (#1918)
Looks like the convention for typescript separator is `;` whereas for flow it's `,`. Let's migrate to that.

Fixes #1896
Fixes #1879
Fixes #1874
2017-06-02 15:32:51 -07:00
Christopher Chedeau e58dd2bf0b Add semi for ts function declarations without body (#1911)
Fixes #1891
2017-06-02 14:49:37 -07:00
Christopher Chedeau faf2ac5f9e Hack to get export default work (#1866)
Fixes #1854
2017-06-02 08:12:03 -07:00
Lucas Azzola 59a760c5d8 TypeScript: fix namespace comment printing (#1765)
* fix(typescript): fix namespace comment printing

* fix(typescript): remove extra newline after comment

* chore(lint): lint changes
2017-05-26 21:30:42 -07:00
Lucas Azzola 934216d852 fix(typescript): allow parens with TSFunctionType and ignore empty specifiers (#1764) 2017-05-26 20:47:48 -07:00
Christopher Chedeau fc88aa185b Add parenthesis around binary expression inside of update expression (#1672)
This is not valid code but TypeScript parses it. It's easy to fix so might as well so we have one less failing test.
2017-05-23 12:33:03 -07:00
Lucas Azzola 599444fe7f fix(typescript): add TSInterfaceHeritage to ast-types (#1644) 2017-05-21 08:10:04 -07:00
Lucas Azzola 575980d7f4 fix(typescript): handle global namespace without modifiers (#1646) 2017-05-21 08:09:29 -07:00
Lucas Azzola 5c6fd80d50 fix(typescript): handle undefined variable declarations (#1645) 2017-05-21 08:03:38 -07:00
Danny Martini fc60d548aa Fix/ts interface heritage (#1601)
* fix TSCallSignature

* fix TSTypeReference

* remove test with invalid syntax

* --wip--

* partially fix TSTypeReference

* get comments right for TypeScript interfaces
2017-05-20 03:15:50 -07:00
Lucas Azzola fa27e5838c feat(typescript): add TSTypeAssertionExpression and naive TSX detection (#1545) 2017-05-07 08:09:52 -07:00
Lucas Azzola 3471ce4584 feat(typescript): print semi instead of comma in TS interface (#1548) 2017-05-07 07:39:21 -07:00
Lucas Azzola 5cc7878902 fix(typescript): fix a handful of ast(prettier(input)) issues (#1544) 2017-05-06 22:34:47 -07:00
Lucas Azzola 92d5a57122 fix(typescript): add TSNamespaceFunctionDeclaration to ast-types (#1543) 2017-05-06 21:33:07 -07:00
Lucas Azzola 5fd9cd01de test(typescript): do not fail debug check on Literal -> Identifier (#1540) 2017-05-06 19:39:19 -07:00
Lucas Azzola 4629db6b0d TypeScript: improve handling of computed properties (#1532)
* fix(typescript): improve handling of computed properties

* test(typescript): add Symbol computed property test

* fix(typescript): do not print brackets for literals
2017-05-06 08:00:26 -07:00
Lucas Azzola 11e3d8241f TypeScript: print modifiers on TSIndexSignature and TSPropertySignature (#1531)
* fix(typescript): print modifiers on TSIndexSignature

* fix(typescript): print modifiers on TSPropertySignature and reformat TSMappedType
2017-05-06 06:18:23 -07:00
Lucas Azzola 8a8a67b9fe fix(typescript): print typeArguments in TSExpressionWithTypeArguments (#1530) 2017-05-06 06:17:48 -07:00
Igor Oleinikov f51822c16d fix(TypeScript): define TSFunctionType AST node (#1529)
- fixes printing of comments inside function type node
2017-05-05 22:14:12 -07:00
Lucas Azzola b23c16d05d fix(typescript): print typeParameters on TSMethodSignature (#1523) 2017-05-05 21:11:13 -07:00
Christopher Chedeau 1a1e6fc1dd Print empty member lookup (#1506)
I have no idea if it's even valid but it threw on 8 typescript tests, now it doesn't.

```js
TypeError: Cannot read property 'type' of null
at printMemberLookup (prettier/src/printer.js:3062:16)
```
2017-05-04 11:20:52 -07:00