Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
feat: kebab-case check in pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 committed Nov 25, 2023
1 parent 87e56aa commit 8277400
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
5 changes: 3 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/bash
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged --verbose
# Run lint-staged first
yarn lint-staged --verbose
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"node": ">=18"
},
"lint-staged": {
"*.{ts}": [
"*.ts": [
"yarn format"
],
"src/**.{ts,json}": [
Expand Down
16 changes: 8 additions & 8 deletions src/handlers/wildcard/unassign/unassign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async function checkTaskToUnassign(context: Context, assignedIssue: Issue) {
const assignEventsOfAssignee = assigneeEvents.filter((event) => {
// check if the event is an assign event and if the assignee is the same as the assignee we're checking
if (event.event == "assigned") {
const assignedEvent = event as AssignedEventExample;
const assignedEvent = event as AssignedEvent;
return assignedEvent.assignee.login === login;
}
});
Expand Down Expand Up @@ -359,7 +359,7 @@ async function getAllCommitsFromPullRequest({ context, owner, repo, pullNumber }
return allCommits;
}

function isCorrectType(event: any): event is AssignedEventExample {
function isCorrectType(event: any): event is AssignedEvent {
return event && typeof event.id === "number" && event.event === "assigned";
}

Expand Down Expand Up @@ -400,16 +400,16 @@ interface GetAllCommits {
repo: string;
pullNumber: number;
}
interface AssignedEventExample {
id: 10841266730;
node_id: "AE_lADOJE8L5s51pPgazwAAAAKGMJoq";
url: "https://api.github.com/repos/pavlovcik/ubiquibot/issues/events/10841266730";
type AssignedEvent = {
id: number;
node_id: string;
url: string;
actor: User;
event: "assigned";
commit_id: null;
commit_url: null;
created_at: "2023-11-02T09:13:58Z";
created_at: string;
assignee: User;
assigner: User;
performed_via_github_app: null;
}
};

0 comments on commit 8277400

Please sign in to comment.