prettier/tests/comments
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
..
__snapshots__ Fix indentation for JSDoc comments (#2470) 2017-10-08 20:34:24 +11:00
assignment-pattern.js Fix unprinted comments in destructuring (#898) 2017-03-05 14:40:03 -08:00
before-comma.js Fix comment detection before comma (#1127) 2017-04-10 11:03:35 -07:00
blank.js Fix files with comments only (#813) 2017-03-07 11:02:45 -08:00
call_comment.js Fix comment for `call( // comment` (#858) 2017-03-03 16:47:13 -05:00
closure-compiler-type-cast.js Handle closure compiler type cast syntax correctly (#2484) 2017-07-25 11:21:25 +10:00
dangling.js Fix missing dangling comment in exports (#741) 2017-02-19 14:39:09 -08:00
dangling_array.js Fix missing dangling comments in arrays (#744) 2017-02-19 17:25:18 -08:00
dangling_for.js Fix missing dangling comments in for loop (#742) 2017-02-20 09:17:10 -05:00
dynamic_imports.js fixes dynamic imports (#2748) 2017-09-05 11:57:36 +10:00
export.js Fix broken export comment (#899) 2017-03-05 21:49:07 -08:00
first-line.js Remove first line special case (#597) 2017-02-04 21:36:48 -05:00
flow_union.js Unrestrict flow union comments check (#1040) 2017-03-20 12:33:42 -04:00
function-declaration.js Handle comments between function name and open paren (#2979) 2017-10-06 20:07:58 +11:00
if.js Fix comment style when placed after if statement test (#2675) 2017-09-08 10:12:10 -07:00
issues.js Fix closing call expression commented out (#530) 2017-01-31 06:52:53 -08:00
jsfmt.spec.js Feature/verify against same snapshot (#1087) 2017-03-25 08:10:17 -07:00
jsx.js Fix indentation for JSDoc comments (#2470) 2017-10-08 20:34:24 +11:00
last-arg.js Preserve inline comment as last argument (#1390) 2017-05-01 14:29:03 -07:00
preserve-new-line-last.js Fix trailing new lines preservation (#724) 2017-02-16 09:56:12 -05:00
return-statement.js Break sequence expressions (#2388) 2017-07-04 22:50:57 +02:00
switch.js Fix trailing comment on switch case (#1136) 2017-04-05 16:27:14 -07:00
template-literal.js [WIP] Fix comments in template literals (#643) 2017-02-23 09:23:56 -08:00
trailing_space.js Trim trailing whitespace from comments, closes #2422 (#2494) 2017-07-16 17:45:27 +10:00
try.js Better support try/catch comments (#607) 2017-02-04 21:25:29 -05:00
variable_declarator.js Stabilize VariableDeclarator comments (#1130) 2017-04-07 07:57:44 -07:00