Commit Graph

12 Commits (master)

Author SHA1 Message Date
Lucas Duailibe 4e8f911a29
Print comment following a JSX generic (#6209) 2019-06-10 09:30:54 -03:00
Sosuke Suzuki 3654108ebe TypeScript: Keep line breaks within mapped types. (#6146) 2019-05-24 19:00:32 -03: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
Lucas Duailibe 5776c8405a
Fix TSMappedType comments (#4418) 2018-05-05 15:43:53 -03:00
Marshall Bowers 445f51709e Fix indentation for JSDoc comments (#2470)
* Fix TypeScript comment snapshot

* Add failing test for TypeScript method comments

* Remove trailing space in comment

* Add snapshot for comment with many lines

* Add TODO marking potential location for comment re-indentation

* Update snapshot

* Indent comments based on the parent node

* Only adjust indentation if the comment looks like a JSDoc comment

* Only strip leading spaces when adjusting comment indentation

* Update snapshot

* Add test to show incorrect indentation based on parent node

* Update snapshot

* Update snapshot

* Update comment indentation to not rely on the parent node

* Extract code for getting the indent size

* Add test where the parent indentation changes as well

* Fix lint warning regarding lexical declarations within case block

* Update lockfile

* Update snapshot

* Add test case for block comment inside of a method

* Replace spread operator with `concat`

* Use `align` instead of `addAlignmentToDoc`

* Add test for mismatched indentation within JSDoc comment

* Always add a leading space to subsequent lines in a JSDoc comment

* Refactor JSDoc comment printing into a separate function

* Remove unneeded `align`

* Replace `forEach` with `map` for better style

* Only `trimLeft` when the end comment token is on the last line of the comment

* Remove unneeded `docBuilders`

* Add tests for JSDoc comments in JSX

* Update snapshots
2017-10-08 20:34:24 +11:00
Karl O'Keeffe 0cc0ebc3bc Allow JSX lines to be recombined (#1831)
* Allow JSX lines to be recombined

* Add test case for `<br />` breaking expression

* Fix issue where JSX whitespace could be dropped

* Newlines were incorrectly being preserved when JSX contained text
2017-06-22 09:19:44 -07:00
James Henry 9b772cb4fd Add test for comment in TypeScript type parameters (#2132) 2017-06-14 20:10:03 +10:00
Christopher Chedeau 1edb1f261b Include typeAnnotation inside of node location (#2039)
We should remove this hack once https://github.com/eslint/typescript-eslint-parser/issues/314 lands

Fixes #1946
2017-06-07 15:05:46 -07:00
Christopher Chedeau 09f147decd Do not throw for unprinted comments inside of JSX (#2036)
Fixes #1990
2017-06-07 12:57:03 -07:00
Christopher Chedeau c46f230a40 Fix TSAbstractClass base (#1676)
This lets the comment traversal code discover it
2017-05-23 12:34:40 -07:00
Christopher Chedeau e37ea2c1f6 Add expression node in TSAsExpression (#1675)
This lets the comment traversal code discover it
2017-05-23 12:33:18 -07:00