Skip to content

Commit

Permalink
upgrade deps, eslint was breaking (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
myyk authored Sep 9, 2021
1 parent fe1050a commit 233b75c
Show file tree
Hide file tree
Showing 10 changed files with 646 additions and 10,358 deletions.
119 changes: 76 additions & 43 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10,795 changes: 519 additions & 10,276 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,25 @@
"author": "Myyk Seok",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.4.0",
"@actions/core": "^1.5.0",
"@actions/github": "^5.0.0",
"date-fns": "^2.23.0"
},
"devDependencies": {
"@types/jest": "^27.0.1",
"@types/js-yaml": "^4.0.3",
"@types/node": "^16.7.13",
"@typescript-eslint/eslint-plugin": "^4.29.3",
"@typescript-eslint/parser": "^4.29.3",
"@types/node": "^16.9.0",
"@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0",
"@vercel/ncc": "^0.29.2",
"eslint": "^7.32.0",
"eslint-plugin-github": "^4.1.5",
"eslint-plugin-github": "^4.2.0",
"eslint-plugin-jest": "^24.4.0",
"jest": "^26.6.3",
"jest-circus": "^27.1.0",
"jest-circus": "^27.1.1",
"js-yaml": "^4.1.0",
"prettier": "2.3.2",
"ts-jest": "^26.5.6",
"typescript": "^4.3.5"
"typescript": "^4.4.2"
}
}
8 changes: 5 additions & 3 deletions src/comments.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {inspect} from 'util'
import {GitHub} from '@actions/github/lib/utils'
import * as core from '@actions/core'
import {Reactions, forIt, againstIt} from './reactions'

import {Reactions, againstIt, forIt} from './reactions'

import {Config} from './config'
import {GitHub} from '@actions/github/lib/utils'
import {inspect} from 'util'

type Octokit = InstanceType<typeof GitHub>

Expand Down
6 changes: 4 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import * as core from '@actions/core'

import {PathLike, promises as fsPromises} from 'fs'

import {inspect} from 'util'
import {promises as fsPromises, PathLike} from 'fs'
import {load as yamlSafeLoad} from 'js-yaml'
import * as core from '@actions/core'

export class Config {
percentageToApprove: number
Expand Down
37 changes: 20 additions & 17 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
import {inspect} from 'util'
/* eslint-disable i18n-text/no-en */
import * as core from '@actions/core'
import * as github from '@actions/github'

import {Config, readVotingConfig} from './config'
import {Voters, readVoters} from './voters'
import {
findVotingComment,
findOrCreateVotingComment,
createVotingCommentBody,
updateVotingComment,
commentToId,
commentToCreatedAt,
closeVotingComment
} from './comments'
import {
readReactionsCounts,
weightedVoteTotaling,
againstIt,
forIt,
againstIt
readReactionsCounts,
weightedVoteTotaling
} from './reactions'
import {readVotingConfig, Config} from './config'
import {readVoters, Voters} from './voters'
import {evaluateVote} from './voting'
import {
closeVotingComment,
commentToCreatedAt,
commentToId,
createVotingCommentBody,
findOrCreateVotingComment,
findVotingComment,
updateVotingComment
} from './comments'

import {GitHub} from '@actions/github/lib/utils'
import {evaluateVote} from './voting'
import {inspect} from 'util'

type Octokit = InstanceType<typeof GitHub>

Expand Down Expand Up @@ -273,7 +276,7 @@ export async function run(): Promise<void> {
const payload = JSON.stringify(github.context.payload, undefined, 2)
core.info(`The event payload: ${payload}`)
} catch (error) {
core.setFailed(`error while running action: ${error.message}`)
core.setFailed(`error while running action: ${error}`)
}
}

Expand Down
11 changes: 6 additions & 5 deletions src/reactions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {inspect} from 'util'
import {GitHub} from '@actions/github/lib/utils'
import * as core from '@actions/core'

import {GitHub} from '@actions/github/lib/utils'
import {Voters} from './voters'
import {inspect} from 'util'

type Octokit = InstanceType<typeof GitHub>

Expand Down Expand Up @@ -91,9 +92,9 @@ export async function weightedVoteTotaling(
const userReactions = await promisedUserReactions
const voters = await promisedVoters

let forItVotes = 0,
againstItVotes = 0,
numVoters = 0
let forItVotes = 0
let againstItVotes = 0
let numVoters = 0
for (const [user, vote] of userReactions) {
const voteWeight = voters.get(user) ?? 0

Expand Down
6 changes: 4 additions & 2 deletions src/voters.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import * as core from '@actions/core'

import {PathLike, promises as fsPromises} from 'fs'

import {inspect} from 'util'
import {promises as fsPromises, PathLike} from 'fs'
import {load as yamlSafeLoad} from 'js-yaml'
import * as core from '@actions/core'

export class Voters extends Map<string, number> {
constructor(obj?: object) {
Expand Down
6 changes: 4 additions & 2 deletions src/voting.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {inspect} from 'util'
import * as core from '@actions/core'

import {Reactions, againstIt, forIt} from './reactions'

import {Config} from './config'
import {Reactions, forIt, againstIt} from './reactions'
import {add} from 'date-fns'
import {inspect} from 'util'

// evaluateVote returns "" on success and the reasons for the vote failing on
// a non-passing vote.
Expand Down

0 comments on commit 233b75c

Please sign in to comment.