Urara-Blog/node_modules/.pnpm-store/v3/files/48/8f688563bb302c2016eeaa4e1a71baa85914802be6e92ba37a908d5061e4f694fca648e2926db1dd3899da74dc6fe3460e1f60cf745bc99e250166bd194635
2022-08-14 01:14:53 +08:00

91 lines
2.5 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export class VFileMessage extends Error {
/**
* Constructor of a message for `reason` at `place` from `origin`.
* When an error is passed in as `reason`, copies the `stack`.
*
* @param {string|Error} reason Reason for message (`string` or `Error`). Uses the stack and message of the error if given.
* @param {Node|NodeLike|Position|Point} [place] Place at which the message occurred in a file (`Node`, `Position`, or `Point`, optional).
* @param {string} [origin] Place in code the message originates from (`string`, optional).
*/
constructor(
reason: string | Error,
place?:
| import('unist').Node<import('unist').Data>
| import('unist').Position
| import('unist').Point
| NodeLike
| undefined,
origin?: string | undefined
)
stack: string | undefined
/**
* Reason for message.
* @type {string}
*/
reason: string
/**
* If true, marks associated file as no longer processable.
* @type {boolean?}
*/
fatal: boolean | null
/**
* Starting line of error.
* @type {number?}
*/
line: number | null
/**
* Starting column of error.
* @type {number?}
*/
column: number | null
/**
* Namespace of warning.
* @type {string?}
*/
source: string | null
/**
* Category of message.
* @type {string?}
*/
ruleId: string | null
/**
* Full range information, when available.
* Has start and end properties, both set to an object with line and column, set to number?.
* @type {Position?}
*/
position: Position | null
/**
* You can use this to specify the source value thats being reported, which
* is deemed incorrect.
* @type {string?}
*/
actual: string | null
/**
* You can use this to suggest values that should be used instead of
* `actual`, one or more values that are deemed as acceptable.
* @type {Array<string>?}
*/
expected: Array<string> | null
/**
* You may add a file property with a path of a file (used throughout the VFile ecosystem).
* @type {string?}
*/
file: string | null
/**
* You may add a url property with a link to documentation for the message.
* @type {string?}
*/
url: string | null
/**
* You may add a note property with a long form description of the message (supported by vfile-reporter).
* @type {string?}
*/
note: string | null
}
export type Node = import('unist').Node
export type Position = import('unist').Position
export type Point = import('unist').Point
export type NodeLike = object & {
type: string
position?: Position | undefined
}