Skip to content

Commit

Permalink
More Eslint -> ESLint
Browse files Browse the repository at this point in the history
  • Loading branch information
sheck committed Oct 10, 2024
1 parent 7d1b5fb commit 61837c7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/eslint_result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { ChangeRange, generateChangeRanges } from "./git_utils"

export type ResultObject = {
filePath: string
messages: EslintMessage[]
messages: ESLintMessage[]
}

type EslintMessage = {
type ESLintMessage = {
ruleId: string
severity: Severity
message: string
Expand All @@ -24,22 +24,22 @@ enum Severity {
Error = 2,
}

export class EslintResult {
export class ESLintResult {
public relevantWarningCount: number = 0
public relevantErrorCount: number = 0
private resultObject: ResultObject
private changeRanges: ChangeRange[]
private relevantMessages: EslintMessage[] = []
private relevantMessages: ESLintMessage[] = []

static async for(
resultObject: ResultObject,
compareSha: string,
): Promise<EslintResult> {
): Promise<ESLintResult> {
const changeRanges = await generateChangeRanges(
resultObject.filePath,
compareSha,
)
return new EslintResult(resultObject, changeRanges)
return new ESLintResult(resultObject, changeRanges)
}

constructor(resultObject: ResultObject, changeRanges: ChangeRange[]) {
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as core from "@actions/core"
import { detectChangedFiles, detectChangedFilesInFolder } from "./git_utils"
import { getExecOutput } from "@actions/exec"
import { ResultObject, EslintResult } from "./eslint_result"
import { ResultObject, ESLintResult } from "./eslint_result"

async function run() {
let workingDirectory = core.getInput("working-directory")
Expand Down Expand Up @@ -57,8 +57,8 @@ async function run() {
let eslintJson = JSON.parse(eslintOut)
core.debug(`Eslint exit code: ${exitCode}`)

let promises: Array<Promise<EslintResult>> = eslintJson.map(
(resultObject: ResultObject) => EslintResult.for(resultObject, compareSha),
let promises: Array<Promise<ESLintResult>> = eslintJson.map(
(resultObject: ResultObject) => ESLintResult.for(resultObject, compareSha),
)
let eslintResults = await Promise.all(promises)

Expand Down

0 comments on commit 61837c7

Please sign in to comment.