@parcel/diagnostic 2.10.3 → 2.12.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/diagnostic.d.ts +9 -9
- package/package.json +2 -2
package/lib/diagnostic.d.ts
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
import type { Mapping } from "@mischnic/json-sourcemap";
|
2
2
|
/** These positions are 1-based (so <code>1</code> is the first line/column) */
|
3
|
-
export
|
3
|
+
export type DiagnosticHighlightLocation = {
|
4
4
|
readonly line: number;
|
5
5
|
readonly column: number;
|
6
6
|
};
|
7
|
-
export
|
7
|
+
export type DiagnosticSeverity = "error" | "warn" | "info";
|
8
8
|
/**
|
9
9
|
* Note: A tab character is always counted as a single character
|
10
10
|
* This is to prevent any mismatch of highlighting across machines
|
11
11
|
*/
|
12
|
-
export
|
12
|
+
export type DiagnosticCodeHighlight = {
|
13
13
|
/** Location of the first character that should get highlighted for this highlight. */
|
14
14
|
start: DiagnosticHighlightLocation;
|
15
15
|
/** Location of the last character that should get highlighted for this highlight. */
|
@@ -22,7 +22,7 @@ export declare type DiagnosticCodeHighlight = {
|
|
22
22
|
* A code frame is a visualization of a piece of code with a certain amount of
|
23
23
|
* code highlights that point to certain chunk(s) inside the code.
|
24
24
|
*/
|
25
|
-
export
|
25
|
+
export type DiagnosticCodeFrame = {
|
26
26
|
/**
|
27
27
|
* The contents of the source file.
|
28
28
|
*
|
@@ -41,7 +41,7 @@ export declare type DiagnosticCodeFrame = {
|
|
41
41
|
* A style agnostic way of emitting errors, warnings and info.
|
42
42
|
* Reporters are responsible for rendering the message, codeframes, hints, ...
|
43
43
|
*/
|
44
|
-
export
|
44
|
+
export type Diagnostic = {
|
45
45
|
/** This is the message you want to log. */
|
46
46
|
message: string;
|
47
47
|
/** Name of plugin or file that threw this error */
|
@@ -70,11 +70,11 @@ export interface PrintableError extends Error {
|
|
70
70
|
} | null | undefined;
|
71
71
|
source?: string;
|
72
72
|
}
|
73
|
-
export
|
73
|
+
export type DiagnosticWithoutOrigin = Diagnostic & {
|
74
74
|
origin?: string;
|
75
75
|
};
|
76
76
|
/** Something that can be turned into a diagnostic. */
|
77
|
-
export
|
77
|
+
export type Diagnostifiable = Diagnostic | Array<Diagnostic> | ThrowableDiagnostic | PrintableError | Error | string;
|
78
78
|
/** Normalize the given value into a diagnostic. */
|
79
79
|
export declare function anyToDiagnostic(input: Diagnostifiable): Array<Diagnostic>;
|
80
80
|
/** Normalize the given error into a diagnostic. */
|
@@ -82,7 +82,7 @@ export declare function errorToDiagnostic(error: ThrowableDiagnostic | Printable
|
|
82
82
|
origin?: string | null | undefined;
|
83
83
|
filePath?: string | null | undefined;
|
84
84
|
}): Array<Diagnostic>;
|
85
|
-
|
85
|
+
type ThrowableDiagnosticOpts = {
|
86
86
|
diagnostic: Diagnostic | Array<Diagnostic>;
|
87
87
|
};
|
88
88
|
/**
|
@@ -143,7 +143,7 @@ export declare function convertSourceLocationToHighlight<Location extends {
|
|
143
143
|
/** Sanitizes object keys before using them as <code>key</code> in generateJSONCodeHighlights */
|
144
144
|
export declare function encodeJSONKeyComponent(component: string): string;
|
145
145
|
export declare function escapeMarkdown(s: string): string;
|
146
|
-
|
146
|
+
type TemplateInput = any;
|
147
147
|
export declare function md(strings: Array<string>, ...params: Array<TemplateInput>): string;
|
148
148
|
export declare namespace md {
|
149
149
|
var bold: (s: any) => any;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@parcel/diagnostic",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.12.0",
|
4
4
|
"license": "MIT",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -27,5 +27,5 @@
|
|
27
27
|
"@mischnic/json-sourcemap": "^0.1.0",
|
28
28
|
"nullthrows": "^1.1.1"
|
29
29
|
},
|
30
|
-
"gitHead": "
|
30
|
+
"gitHead": "2059029ee91e5f03a273b0954d3e629d7375f986"
|
31
31
|
}
|