Ende.lint.SourceCode

interface · experimental

interface Ende.lint.SourceCode

Properties

text

text: string

Get the full source code.

ast

ast: Program

Get the root node of the file. It's always the Program node.

Methods

getText

getText(node?: Node): string

Get the source test of a node. Omit node to get the full source code.

getAncestors

getAncestors(node: Node): Node[]

Returns array of ancestors of the current node, excluding the current node.

getAllComments

getAllComments(): Array<LineComment | BlockComment>

Get all comments inside the source.

getCommentsBefore

getCommentsBefore(node: Node): Array<LineComment | BlockComment>

Get leading comments before a node.

getCommentsAfter

getCommentsAfter(node: Node): Array<LineComment | BlockComment>

Get trailing comments after a node.

getCommentsInside

getCommentsInside(node: Node): Array<LineComment | BlockComment>

Get comments inside a node.