mirror of
https://github.com/denoland/deno.git
synced 2024-11-29 16:30:56 -05:00
82aabb657a
This commit adds a "--no-check" option to following subcommands: - "deno cache" - "deno info" - "deno run" - "deno test" The "--no-check" options allows to skip type checking step and instead directly transpiles TS sources to JS sources. This solution uses `ts.transpileModule()` API and is just an interim solution before implementing it fully in Rust.
23 lines
638 B
TypeScript
23 lines
638 B
TypeScript
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
|
|
|
import type { DiagnosticItem } from "../diagnostics.ts";
|
|
import { sendSync } from "./dispatch_json.ts";
|
|
|
|
export function formatDiagnostics(items: DiagnosticItem[]): string {
|
|
return sendSync("op_format_diagnostic", { items });
|
|
}
|
|
|
|
export interface Location {
|
|
fileName: string;
|
|
lineNumber: number;
|
|
columnNumber: number;
|
|
}
|
|
|
|
export function applySourceMap(location: Location): Location {
|
|
const res = sendSync("op_apply_source_map", location);
|
|
return {
|
|
fileName: res.fileName,
|
|
lineNumber: res.lineNumber,
|
|
columnNumber: res.columnNumber,
|
|
};
|
|
}
|