Honor stdin-filepath when outputting error messages. (#5878)

master
Julien Marchand 2019-02-20 05:39:25 -08:00 committed by Jed Fox
parent db560e4e19
commit ed1db90c68
3 changed files with 4 additions and 2 deletions

View File

@ -42,6 +42,8 @@ Examples:
-->
- CLI: Honor stdin-filepath when outputting error messages.
- Markdown: Do not align table contents if it exceeds the print width and `--prose-wrap never` is set ([#5701] by [@chenshuai2144])
The aligned table is less readable than the compact one

View File

@ -383,7 +383,7 @@ function formatStdin(context) {
writeOutput(context, format(context, input, options), options);
} catch (error) {
handleError(context, "stdin", error);
handleError(context, relativeFilepath || "stdin", error);
}
});
}

View File

@ -16,7 +16,7 @@ exports[`output file as-is if stdin-filepath matched patterns in ignore-path (st
exports[`output file as-is if stdin-filepath matched patterns in ignore-path (write) 1`] = `Array []`;
exports[`throw error if stdin content incompatible with stdin-filepath (stderr) 1`] = `
"[error] stdin: SyntaxError: Unexpected token (1:1)
"[error] abc.js: SyntaxError: Unexpected token (1:1)
[error] > 1 | .name { display: none; }
[error] | ^
"