@parcel/diagnostic 2.0.0-dev.1528 → 2.0.0-dev.1562

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,6 +37,8 @@ export type DiagnosticCodeFrame = {
37
37
  language?: string;
38
38
  codeHighlights: Array<DiagnosticCodeHighlight>;
39
39
  };
40
+ /** A JSON object (as in "map") */
41
+ type JSONObject = Record<string, any>;
40
42
  /**
41
43
  * A style agnostic way of emitting errors, warnings and info.
42
44
  * Reporters are responsible for rendering the message, codeframes, hints, ...
@@ -58,6 +60,8 @@ export type Diagnostic = {
58
60
  skipFormatting?: boolean;
59
61
  /** A URL to documentation to learn more about the diagnostic. */
60
62
  documentationURL?: string;
63
+ /** Diagnostic specific metadata (optional) */
64
+ meta?: JSONObject;
61
65
  };
62
66
  export interface PrintableError extends Error {
63
67
  fileName?: string;
package/lib/diagnostic.js CHANGED
@@ -45,6 +45,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
45
45
  * A code frame is a visualization of a piece of code with a certain amount of
46
46
  * code highlights that point to certain chunk(s) inside the code.
47
47
  */
48
+ /** A JSON object (as in "map") */
48
49
  /**
49
50
  * A style agnostic way of emitting errors, warnings and info.
50
51
  * Reporters are responsible for rendering the message, codeframes, hints, ...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/diagnostic",
3
- "version": "2.0.0-dev.1528+70889ca07",
3
+ "version": "2.0.0-dev.1562+298c035e0",
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": "70889ca07dccb95e21e4c6a2844d632e3723faf4"
30
+ "gitHead": "298c035e0ffb82d7c5579ce233cc35dce2fe1061"
31
31
  }
package/src/diagnostic.js CHANGED
@@ -46,6 +46,12 @@ export type DiagnosticCodeFrame = {|
46
46
  codeHighlights: Array<DiagnosticCodeHighlight>,
47
47
  |};
48
48
 
49
+ /** A JSON object (as in "map") */
50
+ type JSONObject = {
51
+ // $FlowFixMe
52
+ [key: string]: any,
53
+ };
54
+
49
55
  /**
50
56
  * A style agnostic way of emitting errors, warnings and info.
51
57
  * Reporters are responsible for rendering the message, codeframes, hints, ...
@@ -72,6 +78,9 @@ export type Diagnostic = {|
72
78
 
73
79
  /** A URL to documentation to learn more about the diagnostic. */
74
80
  documentationURL?: string,
81
+
82
+ /** Diagnostic specific metadata (optional) */
83
+ meta?: JSONObject,
75
84
  |};
76
85
 
77
86
  // This type should represent all error formats Parcel can encounter...