diff --git a/dist/index.js b/dist/index.js index 38a904c..c721804 100644 --- a/dist/index.js +++ b/dist/index.js @@ -26179,6 +26179,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.EslintResult = void 0; const core = __importStar(__nccwpck_require__(2186)); const git_utils_1 = __nccwpck_require__(5601); +var Severity; +(function (Severity) { + Severity[Severity["Warning"] = 1] = "Warning"; + Severity[Severity["Error"] = 2] = "Error"; +})(Severity || (Severity = {})); class EslintResult { relevantWarningCount = 0; relevantErrorCount = 0; @@ -26206,10 +26211,10 @@ class EslintResult { endColumn: msg.endColumn, }; switch (msg.severity) { - case 1: + case Severity.Warning: core.warning(msg.message, options); break; - case 2: + case Severity.Error: core.error(msg.message, options); default: break; diff --git a/src/eslint_result.ts b/src/eslint_result.ts index d580cef..281cfb1 100644 --- a/src/eslint_result.ts +++ b/src/eslint_result.ts @@ -8,7 +8,7 @@ export type ResultObject = { type EslintMessage = { ruleId: string - severity: number + severity: Severity message: string line: number column: number @@ -19,6 +19,11 @@ type EslintMessage = { suggestions: any[] } +enum Severity { + Warning = 1, + Error = 2, +} + export class EslintResult { public relevantWarningCount: number = 0 public relevantErrorCount: number = 0 @@ -55,10 +60,10 @@ export class EslintResult { endColumn: msg.endColumn, } switch (msg.severity) { - case 1: + case Severity.Warning: core.warning(msg.message, options) break - case 2: + case Severity.Error: core.error(msg.message, options) default: break