UNPKG

@sasjs/lint

Version:

Linting and formatting for SAS code

25 lines 1.4 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.lintText = void 0; const getLintConfig_1 = require("../utils/getLintConfig"); const shared_1 = require("./shared"); /** * Analyses and produces a set of diagnostics for the given text content. * @param {string} text - the text content to be linted. * @returns {Diagnostic[]} array of diagnostic objects, each containing a warning, line number and column number. */ const lintText = (text) => __awaiter(void 0, void 0, void 0, function* () { const config = yield (0, getLintConfig_1.getLintConfig)(); return (0, shared_1.processText)(text, config); }); exports.lintText = lintText; //# sourceMappingURL=lintText.js.map