JSONReporter
Extends:
Constructor Summary
Public Constructor | ||
public |
constructor(inspector: Inspector, opts: object) A JSON reporter, which displays both file and line information for each given match. |
Method Summary
Private Methods | ||
private |
_getOutput(match: Match): string Returns the string output to print for the given reporter. |
Inherited Summary
From class BaseReporter | ||
private |
_getAbsolutePath(filePath: string): string Returns the absolute path for a file. |
|
private |
_getFormattedLocation(instance: Object): string 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 |
Returns the lines associated with an instance. |
|
private |
_getRelativePath(filePath: string): string 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
A JSON reporter, which displays both file and line information for each given match.
Override:
BaseReporter#constructorPrivate Methods
private _getOutput(match: Match): string source
Returns the string output to print for the given reporter. The formatted JSON string contains the number of instances associated with the match and the files and lines involved.
Params:
Name | Type | Attribute | Description |
match | Match | The inspector match to output |