123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- /**
- * Message.
- */
- export class VFileMessage extends Error {
- constructor(reason: string, options?: Options | null | undefined)
- constructor(
- reason: string,
- parent: Node | NodeLike | null | undefined,
- origin?: string | null | undefined
- )
- constructor(
- reason: string,
- place: Point | Position | null | undefined,
- origin?: string | null | undefined
- )
- constructor(reason: string, origin?: string | null | undefined)
- constructor(
- cause: Error | VFileMessage,
- parent: Node | NodeLike | null | undefined,
- origin?: string | null | undefined
- )
- constructor(
- cause: Error | VFileMessage,
- place: Point | Position | null | undefined,
- origin?: string | null | undefined
- )
- constructor(cause: Error | VFileMessage, origin?: string | null | undefined)
- /**
- * Stack of ancestor nodes surrounding the message.
- *
- * @type {Array<Node> | undefined}
- */
- ancestors: Array<Node> | undefined
- /**
- * Starting column of message.
- *
- * @type {number | undefined}
- */
- column: number | undefined
- /**
- * State of problem.
- *
- * * `true` — error, file not usable
- * * `false` — warning, change may be needed
- * * `undefined` — change likely not needed
- *
- * @type {boolean | null | undefined}
- */
- fatal: boolean | null | undefined
- /**
- * Path of a file (used throughout the `VFile` ecosystem).
- *
- * @type {string | undefined}
- */
- file: string | undefined
- /**
- * Starting line of error.
- *
- * @type {number | undefined}
- */
- line: number | undefined
- /**
- * Place of message.
- *
- * @type {Point | Position | undefined}
- */
- place: Point | Position | undefined
- /**
- * Reason for message, should use markdown.
- *
- * @type {string}
- */
- reason: string
- /**
- * Category of message (example: `'my-rule'`).
- *
- * @type {string | undefined}
- */
- ruleId: string | undefined
- /**
- * Namespace of message (example: `'my-package'`).
- *
- * @type {string | undefined}
- */
- source: string | undefined
- /**
- * Specify the source value that’s being reported, which is deemed
- * incorrect.
- *
- * @type {string | undefined}
- */
- actual: string | undefined
- /**
- * Suggest acceptable values that can be used instead of `actual`.
- *
- * @type {Array<string> | undefined}
- */
- expected: Array<string> | undefined
- /**
- * Long form description of the message (you should use markdown).
- *
- * @type {string | undefined}
- */
- note: string | undefined
- /**
- * Link to docs for the message.
- *
- * > 👉 **Note**: this must be an absolute URL that can be passed as `x`
- * > to `new URL(x)`.
- *
- * @type {string | undefined}
- */
- url: string | undefined
- }
- export type Node = import('unist').Node
- export type Point = import('unist').Point
- export type Position = import('unist').Position
- export type NodeLike = object & {
- type: string
- position?: Position | undefined
- }
- /**
- * Configuration.
- */
- export type Options = {
- /**
- * Stack of (inclusive) ancestor nodes surrounding the message (optional).
- */
- ancestors?: Array<Node> | null | undefined
- /**
- * Original error cause of the message (optional).
- */
- cause?: Error | null | undefined
- /**
- * Place of message (optional).
- */
- place?: Point | Position | null | undefined
- /**
- * Category of message (optional, example: `'my-rule'`).
- */
- ruleId?: string | null | undefined
- /**
- * Namespace of who sent the message (optional, example: `'my-package'`).
- */
- source?: string | null | undefined
- }
|