prettier/src
Christopher Chedeau 9cd4517a64 Fix template literal comments (#1296)
The implementation was checking if the comment was inside of the expression range, which seems like a good idea. Unfortunately, the expression range is not what's inside of `${}` but the actual AST node, which incidentally doesn't include comments. So the logic was off and returned `undefined` which threw afterwards.

Another solution is to find the first quasi where start is > comment start. This means that the comment appeared between the quasi before and this one... therefore in the expression before!

The flow parser has issues with unicode where it makes node location invalid, there are likely other places where node locations are off. So instead of throwing with a weird error, let's attach it to the first one if it doesn't work.

Fixes #1293
2017-04-17 11:35:12 -04:00
..
comments.js Fix template literal comments (#1296) 2017-04-17 11:35:12 -04:00
deprecated.js Run prettier on 0.13.0 (#497) 2017-01-28 07:50:22 -08:00
doc-builders.js Refactored option to indent with tabs (#1026) 2017-04-06 22:49:37 -04:00
doc-debug.js Format the codebase using the pre-1.0 release (#1194) 2017-04-12 10:16:11 -07:00
doc-printer.js Remove trailing whitespace (#1259) 2017-04-13 18:31:49 -07:00
doc-utils.js Fix edge cases triggered by newlines in arrow functions (#1217) 2017-04-13 09:21:18 -07:00
fast-path.js Format the codebase using the pre-1.0 release (#1194) 2017-04-12 10:16:11 -07:00
options.js Enable no-semi mode and protect against ASI failures (#1129) 2017-04-11 13:50:47 -07:00
parser.js Format the codebase using the pre-1.0 release (#1194) 2017-04-12 10:16:11 -07:00
printer.js [WIP] no-semi comments (#1257) 2017-04-13 18:33:46 -07:00
util.js Fix isPreviousLineEmpry on Windows (#1263) 2017-04-14 16:02:19 -07:00