'use strict' ; import { TsLinter } from './tsLinter' ; import { IRuleMetadata } from 'tslint' ; import { IConfig , loadCodeClimateConfig } from './codeclimate' ; import { getRules } from './ruleLoader' ; import { map } from 'rxjs/operators' ; /** A path where code under analysis is deployed */ const targetPath = '/code/' ; /** A path where this codeclimate-tslint program is installed on Docker container */ const linterPath = '/usr/src/app/' ; /** Codeclimate config path */ const configPath = '/config.json' ; const codeClimateConfig = loadCodeClimateConfig ( configPath ) ; const rules = getRules ( linterPath ) ; const tsLinter = new TsLinter ( { targetPath , linterPath , codeClimateConfig , rules } ) ; tsLinter . lint ( ) . pipe ( map ( j => JSON . stringify ( j ) ) , map ( json => `${ json }\u0000` ) ) . subscribe ( line => console . log ( line ) ) ;