UNPKG

@sasjs/lint

Version:

Linting and formatting for SAS code

28 lines 1.63 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.lintProject = void 0; const getProjectRoot_1 = require("../utils/getProjectRoot"); const lintFolder_1 = require("./lintFolder"); /** * Analyses and produces a set of diagnostics for the current project. * @returns {Promise<Map<string, Diagnostic[]>>} Resolves with a map with array of diagnostic objects, each containing a warning, line number and column number, and grouped by file path. */ const lintProject = () => __awaiter(void 0, void 0, void 0, function* () { const projectRoot = (yield (0, getProjectRoot_1.getProjectRoot)()) || process.currentDir; if (!projectRoot) { throw new Error('SASjs Project Root was not found.'); } console.info(`Linting all .sas files under ${projectRoot}`); return yield (0, lintFolder_1.lintFolder)(projectRoot); }); exports.lintProject = lintProject; //# sourceMappingURL=lintProject.js.map