File tree Expand file tree Collapse file tree 3 files changed +291
-81
lines changed Expand file tree Collapse file tree 3 files changed +291
-81
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,13 @@ type MaybeBuffer = any extends Buffer ? never : Buffer
11
11
12
12
/**
13
13
* Contents of the file.
14
- * Can either be text, or a Buffer like structure.
15
- * This does not directly use type `Buffer`, because it can also be used in a
16
- * browser context.
17
- * Instead this leverages `Uint8Array` which is the base type for `Buffer`,
18
- * and a native JavaScript construct.
14
+ *
15
+ * Can either be text or a `Buffer` structure.
19
16
*/
17
+ // Note: this does not directly use type `Buffer`, because it can also be used
18
+ // in a browser context.
19
+ // Instead this leverages `Uint8Array` which is the base type for `Buffer`,
20
+ // and a native JavaScript construct.
20
21
export type Value = string | MaybeBuffer
21
22
22
23
/**
@@ -37,7 +38,7 @@ export type Value = string | MaybeBuffer
37
38
export interface DataMap { }
38
39
39
40
/**
40
- * Place to store custom information.
41
+ * Custom information.
41
42
*
42
43
* Known attributes can be added to @see {@link DataMap}
43
44
*/
Original file line number Diff line number Diff line change 17
17
* being needed.
18
18
* Copied from: <https://github.com/DefinitelyTyped/DefinitelyTyped/blob/90a4ec8/types/node/buffer.d.ts#L170>
19
19
*
20
- * @typedef {Value | Options | VFile | URL } Compatible
20
+ * @typedef {Options | URL | Value | VFile } Compatible
21
21
* Things that can be passed to the constructor.
22
22
*
23
23
* @typedef VFileCoreOptions
42
42
* Set `data`.
43
43
*
44
44
* @typedef Map
45
- * Raw source map, see:
45
+ * Raw source map.
46
+ *
47
+ * See:
46
48
* <https://github.com/mozilla/source-map/blob/58819f0/source-map.d.ts#L15-L23>.
47
49
* @property {number } version
48
50
* Which version of the source map spec this map is following.
72
74
* @template {ReporterSettings} Settings
73
75
* Options type.
74
76
* @callback Reporter
75
- * Type for a report .
77
+ * Type for a reporter .
76
78
* @param {Array<VFile> } files
77
79
* Files to report.
78
80
* @param {Settings } options
@@ -403,7 +405,7 @@ export class VFile {
403
405
}
404
406
405
407
/**
406
- * Create an informational message associated with the file.
408
+ * Create an info message associated with the file.
407
409
*
408
410
* Its `fatal` is set to `null` and `file` is set to the current file path.
409
411
* Its added to `file.messages`.
@@ -443,6 +445,8 @@ export class VFile {
443
445
* `'my-package:my-rule'` or `'my-rule'`).
444
446
* @returns {never }
445
447
* Message.
448
+ * @throws {VFileMessage }
449
+ * Message.
446
450
*/
447
451
fail ( reason , place , origin ) {
448
452
const message = this . message ( reason , place , origin )
You can’t perform that action at this time.
0 commit comments