UNPKG

@softwareventures/maintain-project

Version:

Automatically create and maintain TypeScript projects with standard settings for Software Ventures Limited

20 lines 931 B
import { Configuration } from "tslint"; import { mapNullable } from "@softwareventures/nullable"; import { projectDevDependsOn } from "../project/dev-depends-on.js"; export async function readTslintProject(project) { const dependsOnTslint = projectDevDependsOn(project, "tslint"); const dependsOnSoftwareVenturesPreset = projectDevDependsOn(project, "@softwareventures/tslint-rules"); const configPath = Configuration.findConfigurationPath(null, project.path); const config = mapNullable(configPath, path => Configuration.readConfigurationFile(path)); if (!(await dependsOnTslint) || config == null) { return undefined; } else if ((await dependsOnSoftwareVenturesPreset) && (config.extends?.includes("@softwareventures/tslint-rules") ?? false)) { return { preset: "softwareventures" }; } else { return { preset: "other" }; } } //# sourceMappingURL=read.js.map