Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
farski committed Oct 14, 2024
1 parent 7b50121 commit 3ca7f35
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/alarm-slack-report/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
EventBridgeClient,
PutEventsCommand,
} from "@aws-sdk/client-eventbridge";
import regions from "./regions.mjs";
import { alarmConsole, ssoDeepLink } from "./urls.mjs";
// import regions from "./regions.mjs";
// import { alarmConsole, ssoDeepLink } from "./urls.mjs";

const sts = new STSClient({ apiVersion: "2011-06-15" });
const eventbridge = new EventBridgeClient({ apiVersion: "2015-10-07" });
Expand Down Expand Up @@ -83,20 +83,20 @@ async function describeAllAlarms(cwClient, nextToken) {
return results;
}

function cleanName(alarmName) {
return alarmName
.replace(/>/g, ">")
.replace(/</g, "&lt;")
.replace(/\([A-Za-z0-9_-]+\)$/, "")
.replace(/^(FATAL|ERROR|WARN|INFO|CRITICAL|MAJOR|MINOR)/, "")
.trim();
}

function title(alarmDetail) {
const name = alarmDetail.AlarmName;
const region = regions(alarmDetail.AlarmArn.split(":")[3]);
return `${alarmDetail.StateValue} | ${region} » ${cleanName(name)}`;
}
// function cleanName(alarmName) {
// return alarmName
// .replace(/>/g, "&gt;")
// .replace(/</g, "&lt;")
// .replace(/\([A-Za-z0-9_-]+\)$/, "")
// .replace(/^(FATAL|ERROR|WARN|INFO|CRITICAL|MAJOR|MINOR)/, "")
// .trim();
// }

// function title(alarmDetail) {
// const name = alarmDetail.AlarmName;
// const region = regions(alarmDetail.AlarmArn.split(":")[3]);
// return `${alarmDetail.StateValue} | ${region} » ${cleanName(name)}`;
// }

function filterByName(alarm) {
return !(
Expand Down

0 comments on commit 3ca7f35

Please sign in to comment.