From b427e8b758ba968cc101f61c6f0fd9aad351bae9 Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Sun, 11 Feb 2024 06:19:21 +0000 Subject: [PATCH] Passing lint checks --- .github/linters/.eslintrc.yml | 2 ++ __tests__/main.test.ts | 7 ------- dist/index.js | 2 +- src/main.ts | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/linters/.eslintrc.yml b/.github/linters/.eslintrc.yml index f452aba..c32d906 100644 --- a/.github/linters/.eslintrc.yml +++ b/.github/linters/.eslintrc.yml @@ -42,6 +42,7 @@ rules: 'i18n-text/no-en': 'off', 'import/no-namespace': 'off', 'no-console': 'off', + 'no-shadow': 'off', 'no-unused-vars': 'off', 'prettier/prettier': 'error', 'semi': 'off', @@ -64,6 +65,7 @@ rules: '@typescript-eslint/no-namespace': 'error', '@typescript-eslint/no-non-null-assertion': 'warn', '@typescript-eslint/no-require-imports': 'error', + '@typescript-eslint/no-shadow': 'warn', '@typescript-eslint/no-unnecessary-qualifier': 'error', '@typescript-eslint/no-unnecessary-type-assertion': 'error', '@typescript-eslint/no-unused-vars': 'error', diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index 56517e0..c5242a0 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -12,23 +12,16 @@ import * as main from '../src/main' // Mock the action's main function const runMock = jest.spyOn(main, 'run') -// Other utilities -const timeRegex = /^\d{2}:\d{2}:\d{2}/ - // Mock the GitHub Actions core library -let debugMock: jest.SpyInstance let errorMock: jest.SpyInstance let getInputMock: jest.SpyInstance -let setFailedMock: jest.SpyInstance describe('action', () => { beforeEach(() => { jest.clearAllMocks() - debugMock = jest.spyOn(core, 'debug').mockImplementation() errorMock = jest.spyOn(core, 'error').mockImplementation() getInputMock = jest.spyOn(core, 'getInput').mockImplementation() - setFailedMock = jest.spyOn(core, 'setFailed').mockImplementation() }) it('sets the time output', async () => { diff --git a/dist/index.js b/dist/index.js index 85b58d9..e97019c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29030,7 +29030,7 @@ async function run() { body: matchFoundMessage, commit_id: context.payload.pull_request.head.sha, path: currentFile, - side: side, + side, line: currentLineNumber }); } diff --git a/src/main.ts b/src/main.ts index dd1343b..1056441 100644 --- a/src/main.ts +++ b/src/main.ts @@ -99,7 +99,7 @@ export async function run(): Promise { body: matchFoundMessage, commit_id: context.payload.pull_request.head.sha, path: currentFile, - side: side, + side, line: currentLineNumber }) } else {