prettierx
Version:
prettierX - a less opinionated fork of the Prettier code formatter
14 lines (11 loc) • 314 B
JavaScript
;
function createError(message, loc) {
// Construct an error similar to the ones thrown by Babel.
const error = new SyntaxError(
message + " (" + loc.start.line + ":" + loc.start.column + ")"
);
// @ts-ignore - TBD (...)
error.loc = loc;
return error;
}
module.exports = createError;