@atomist/sdm
Version:
Atomist Software Delivery Machine SDK
56 lines • 2.27 kB
TypeScript
import { ProjectReview, ReviewComment } from "@atomist/automation-client/lib/operations/review/ReviewResult";
import { NoParameters } from "@atomist/automation-client/lib/SmartParameters";
import { AutoInspectRegistration } from "../../../api/registration/AutoInspectRegistration";
import { CodeInspection, CodeInspectionRegistration } from "../../../api/registration/CodeInspectionRegistration";
export interface TslintPosition {
character: number;
line: number;
position: number;
}
export interface TslintFix {
innerStart: number;
innerLength: number;
innerText: string;
}
/**
* Manually created interface representing the JSON output of the
* tslint command-line utility.
*/
export interface TslintResult {
endPosition: TslintPosition;
failure: string;
fix: TslintFix | TslintFix[];
name: string;
ruleName: string;
ruleSeverity: "ERROR" | "WARNING";
startPosition: TslintPosition;
}
export declare type TslintResults = TslintResult[];
export declare const tsLintReviewCategory = "Tslint";
/**
* Convert the JSON output of TSLint to proper ReviewComments. If any
* part of the process fails, an empty array is returned.
*
* @param tslintOutput string output from running `tslint` that will be parsed and converted.
* @return TSLint errors and warnings as ReviewComments
*/
export declare function mapTslintResultsToReviewComments(tslintOutput: string, dir: string): ReviewComment[];
/**
* Run TSLint on a project with a tslint.json file, using the standard
* version of TSLint and its configuration, i.e., the ones in this
* project. At most 20 TSLint violations are returned, since they are
* used to create a GitHub issue and if the body of that POST is too
* large, it is rejected.
*/
export declare const RunTslintOnProject: CodeInspection<ProjectReview, NoParameters>;
/**
* Provide a code inspection that runs TSLint and returns a
* ProjectReview.
*/
export declare const TslintInspection: CodeInspectionRegistration<ProjectReview, NoParameters>;
/**
* Provide an auto inspect registration that runs TSLint and returns a
* ProjectReview.
*/
export declare const TslintAutoInspectRegistration: AutoInspectRegistration<ProjectReview, NoParameters>;
//# sourceMappingURL=tslint.d.ts.map