Skip to content

Commit

Permalink
chore: fixed TypeScript compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernand authored and Fernand committed Mar 21, 2024
1 parent b18ed58 commit 4826e44
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
10 changes: 5 additions & 5 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { config } from "dotenv";
// import { config } from "dotenv";
import type { Config } from "jest";

config();
const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
const OPENAI_API_KEY = process.env.OPENAI_API_KEY;
process.argv = ["path/to/node", "path/to/script", `--auth`, `${GITHUB_TOKEN}`, "--open-ai", `${OPENAI_API_KEY}`];
// config();
// const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
// const OPENAI_API_KEY = process.env.OPENAI_API_KEY;
// process.argv = ["path/to/node", "path/to/script", `--auth`, `${GITHUB_TOKEN}`, "--open-ai", `${OPENAI_API_KEY}`];

const cfg: Config = {
transform: {
Expand Down
1 change: 0 additions & 1 deletion src/parser/data-purge-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export class DataPurgeModule implements Module {
{
content: newContent,
url: value.html_url,
contentHtml: value.body_html,
type: value.type,
},
];
Expand Down
5 changes: 2 additions & 3 deletions src/parser/processor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as fs from "fs";
import configuration from "../configuration/config-reader";
import { GetActivity } from "../get-activity";
import { CommentType, GetActivity } from "../get-activity";
import program from "./command-line";
import { ContentEvaluatorModule } from "./content-evaluator-module";
import { DataPurgeModule } from "./data-purge-module";
Expand Down Expand Up @@ -85,9 +85,8 @@ export interface Result {

export interface GithubComment {
content: string;
contentHtml?: string;
url: string;
type: string;
type: CommentType;
score?: {
formatting?: {
content: Record<string, { count: number; score: number }>;
Expand Down
4 changes: 2 additions & 2 deletions src/parser/user-extractor-module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import configuration from "../configuration/config-reader";
import { GetActivity } from "../get-activity";
import { GitHubIssue, GitHubIssueComment, GitHubPullRequestReviewComment } from "../github-types";
import { GitHubIssue } from "../github-types";
import { Module, Result } from "./processor";

/**
Expand All @@ -16,7 +16,7 @@ export class UserExtractorModule implements Module {
/**
* Checks if the comment is made by a human user, and not empty.
*/
_checkEntryValidity(comment: GitHubIssueComment | GitHubPullRequestReviewComment) {
_checkEntryValidity(comment: (typeof GetActivity.prototype.allComments)[0]) {
return comment.body && comment.user?.type === "User";
}

Expand Down

0 comments on commit 4826e44

Please sign in to comment.