UNPKG

@sasjs/lint

Version:

Linting and formatting for SAS code

35 lines 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.noTrailingSpaces = void 0; const LintRuleType_1 = require("../../types/LintRuleType"); const Severity_1 = require("../../types/Severity"); const name = 'noTrailingSpaces'; const description = 'Disallow trailing spaces on lines.'; const message = 'Line contains trailing spaces'; const test = (value, lineNumber, config) => { const severity = (config === null || config === void 0 ? void 0 : config.severityLevel[name]) || Severity_1.Severity.Warning; return value.trimEnd() === value ? [] : [ { message, lineNumber, startColumnNumber: value.trimEnd().length + 1, endColumnNumber: value.length, severity } ]; }; const fix = (value) => value.trimEnd(); /** * Lint rule that checks for the presence of trailing space(s) in a given line of text. */ exports.noTrailingSpaces = { type: LintRuleType_1.LintRuleType.Line, name, description, message, test, fix }; //# sourceMappingURL=noTrailingSpaces.js.map