test: port over line-after-filepath-with-errors test#35
test: port over line-after-filepath-with-errors test#35fabiospampinato merged 3 commits intoprettier:mainfrom
line-after-filepath-with-errors test#35Conversation
| }); | ||
| // TODO (43081j): this test throws errors in prettier. here it doesn't, and | ||
| // lists each invalid file path in the output (stderr). we should decide | ||
| // if to align with prettier |
There was a problem hiding this comment.
see this TODO and the one above
this has been raised in another PR too. basically this block:
Lines 181 to 185 in 5d5a6ca
means that with no args, errors are not raised and are ignored
this means running with list: true or check: true behaves differently than with no args (i.e. both false)
There was a problem hiding this comment.
I think we should first add the fourth mode of operation as mentioned in #30, then I need to look at what the difference is exactly, because if prettier just throws it seems better to output a comprehensible error, while still erroring, no?
There was a problem hiding this comment.
The "forth mode", "dump" is implemented now, maybe we can reference that here if needed.
There was a problem hiding this comment.
the two tests fail in prettier because the files matching the glob are invalid I think (syntax errors)
so in this test (--list-different) and the argless one, we do error in prettier but not in prettier CLI
the fourth mode doesn't seem relevant now that I think about it. in general if a glob matches invalid files, it seems we skip them? but I don't remember what past-james was doing here, so I'm just going off the TODOs
There was a problem hiding this comment.
I think if aligning with the old CLI in this aspect isn't a huge pain in the ass we should just do that 🤔 That seems the only blocker for this PR, right?
0c953fb to
ada6549
Compare
18074f4 to
fd79cfa
Compare
|
Blocked by #51 |
34e0257 to
f8dc396
Compare
|
#51 got addressed, maybe this can be finished now. |
e2dd09d to
a80310c
Compare
|
i dont remember anymore what we wanted the tests pass now and i caught the branch up i suggest we just get this merged before we forget again whats going on. presumably |
|
I think we need to rebase this PR on top of the fix for forward slashes in snapshots to make the tests for Windows pass. |
Copies the `line-after-filepath-with-errors` tests from prettier. Notes on differences: - Running `prettier ./*` vs `prettier --check ./*` has different behaviour for invalid files. in the former, no errors are raised and the files are essentially ignored. We should decide if this is expected - Running with `--list-different`, invalid files have their paths listed in stderr, while in prettier they will raise errors.
|
Thanks! |
Copies the
line-after-filepath-with-errorstests from prettier.Notes on differences:
prettier ./*vsprettier --check ./*has different behaviour for invalid files. in the former, no errors are raised and the files are essentially ignored. We should decide if this is expected--list-different, invalid files have their paths listed in stderr, while in prettier they will raise errors.