Skip to content

Commit

Permalink
Merge pull request #286 from riley-kohler/fix_inconsistent_eslint_issues
Browse files Browse the repository at this point in the history
fix: resolve inconsistent eslint issues
  • Loading branch information
riley-kohler authored Dec 16, 2024
2 parents 60073ac + 29cdebb commit de4b29d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/app/api/auth/lib/nextauth-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const verifySession = async (token: string | undefined) => {
try {
await octokit.rest.users.getAuthenticated()
return true
} catch (error) {
} catch {
return false
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/bot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const getMetadata = (

try {
return JSON.parse(description) as Record<string, string>
} catch (error) {
} catch {
botLogger.warn('Failed to parse repository description', { description })
return {}
}
Expand Down
4 changes: 2 additions & 2 deletions src/types/forks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { z } from 'zod'

// this type is generated from the graphql query to support
// the requirements of the primer datatable component
const forksObject = z.object({
const ForksObject = z.object({
organization: z.object({
repositories: z.object({
totalCount: z.number(),
Expand Down Expand Up @@ -40,4 +40,4 @@ const forksObject = z.object({
}),
})

export type ForksObject = z.infer<typeof forksObject>
export type ForksObject = z.infer<typeof ForksObject>
10 changes: 5 additions & 5 deletions src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Logger } from 'tslog'
const stringify = (obj: any) => {
try {
return JSON.stringify(obj)
} catch (e) {
} catch {
return safeStringify(obj)
}
}
Expand All @@ -26,7 +26,7 @@ const getLoggerType = () => {
}

// Map logger level name to number for tsLog
const mapLevelToMethod: { [key: string]: number } = {
const mapLevelToMethod: Record<string, number> = {
silly: 0,
trace: 1,
debug: 2,
Expand All @@ -39,7 +39,7 @@ const mapLevelToMethod: { [key: string]: number } = {
export const logger = new Logger({
type: getLoggerType(),
minLevel:
mapLevelToMethod[process.env.LOGGING_LEVEL?.toLowerCase() || 'info'],
mapLevelToMethod[process.env.LOGGING_LEVEL?.toLowerCase() ?? 'info'],
maskValuesRegEx: [
/"access[-._]?token":"[^"]+"/g,
/"api[-._]?key":"[^"]+"/g,
Expand Down Expand Up @@ -70,7 +70,7 @@ export const logger = new Logger({

// set message if it's a string or set it as info
if (
Object.prototype.hasOwnProperty.call(logObjWithMeta, '0') &&
Object.hasOwn(logObjWithMeta, '0') &&
typeof logObjWithMeta['0'] === 'string'
) {
output.message = logObjWithMeta['0']
Expand All @@ -79,7 +79,7 @@ export const logger = new Logger({
}

// set data
if (Object.prototype.hasOwnProperty.call(logObjWithMeta, '1')) {
if (Object.hasOwn(logObjWithMeta, '1')) {
output.data = logObjWithMeta['1']
}

Expand Down

0 comments on commit de4b29d

Please sign in to comment.