import { RepositoryScorer } from "@atomist/sdm-pack-aspect" ; import { NpmDeps } from "@atomist/sdm-pack-fingerprint" ; import { TypeScriptVersionType } from "../aspect/node/TypeScriptVersion" ; param { TaggedRepo } repo return { Promise < any > } constructor export const TypeScriptProjectsMustUseTsLint = { name : "has-tslint" , scoreFingerprints : async ( repo ) => { const isTs = repo . analysis . fingerprints . some ( fp => fp . type === TypeScriptVersionType ) ; if ( ! isTs ) { return undefined ; } const hasTsLint = repo . analysis . fingerprints . some ( fp => fp . type === NpmDeps . name && fp . data [ 0 ] === "tslint" ) ; return { score : hasTsLint ? 5 : 1 , reason : hasTsLint ? "TypeScript projects should use tslint" : "TypeScript project using tslint" , } ; } , } ;