Home Reference Source Test
public class | source

DefaultReporter

Extends:

BaseReporter → DefaultReporter

Constructor Summary

Public Constructor
public

constructor(inspector: Inspector, opts: object)

The default reporter, which displays both file and line information for each given match.

Method Summary

Private Methods
private

Returns the string output to print for the given reporter.

Inherited Summary

From class BaseReporter
private

Returns the absolute path for a file.

private

Returns a string containing the path to the file in which the nodes are located, as well as the lines on which the nodes exist.

private

_getLines(instance: Object): string

Returns the lines associated with an instance.

private

Returns the relative path for a file.

private

Registers a listener to the "match" event exposed by the Inspector instance.

private

Registers a listener that prints a final summary outlining the number of matches detected, as well as the number of files analyzed.

Public Constructors

public constructor(inspector: Inspector, opts: object) source

The default reporter, which displays both file and line information for each given match.

Override:

BaseReporter#constructor

Params:

NameTypeAttributeDescription
inspector Inspector

Instance on which to register its listeners

opts object

Options to set for the reporter

Private Methods

private _getOutput(match: Match): string source

Returns the string output to print for the given reporter. The string contains the number of instances associated with the match and the files and lines involved.

Params:

NameTypeAttributeDescription
match Match

The inspector match to output

Return:

string

The formatted output