Skip to content

Commit

Permalink
chore(deps-dev): bump @ridedott/eslint-config from 2.13.22 to 2.19.21
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Mar 23, 2022
1 parent 05d5c7c commit 1ea3ca2
Show file tree
Hide file tree
Showing 15 changed files with 1,272 additions and 1,178 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ overrides:
rules:
'@typescript-eslint/camelcase': 'off'
'@typescript-eslint/no-magic-numbers': 'off'
'max-lines': 'off'
jest/require-hook: 'error'
max-lines: 'off'
max-lines-per-function: 'off'
no-magic-numbers: 'off'
max-statements: 'off'
Expand All @@ -23,4 +24,5 @@ parserOptions:
project: tsconfig.json
sourceType: module
rules:
jest/require-hook: 'off'
no-negated-condition: 'off'
2,354 changes: 1,222 additions & 1,132 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"devDependencies": {
"@commitlint/cli": "^16.2.3",
"@commitlint/config-conventional": "^16.2.1",
"@ridedott/eslint-config": "^2.13.22",
"@ridedott/eslint-config": "^2.19.21",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/exec": "^5.0.0",
"@semantic-release/git": "^9.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/common/getPullRequestCommits.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getOctokit } from '@actions/github';
import { GraphQlQueryResponseData } from '@octokit/graphql';
import type { GraphQlQueryResponseData } from '@octokit/graphql';

import { PullRequestCommitNode } from '../types';
import { IterableList, makeGraphqlIterator } from './makeGraphqlIterator';
Expand Down
1 change: 1 addition & 0 deletions src/common/getPullRequestInformation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ describe('getPullRequestInformation', (): void => {

nock('https://api.github.com', {
reqheaders: {
// eslint-disable-next-line jest/no-conditional-in-test
accept: githubPreviewApiEnabled
? 'application/vnd.github.merge-info-preview+json'
: 'application/vnd.github.v3+json',
Expand Down
3 changes: 2 additions & 1 deletion src/common/listBranchProtectionRules.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getOctokit } from '@actions/github';
import { GraphQlQueryResponseData } from '@octokit/graphql';
import type { GraphQlQueryResponseData } from '@octokit/graphql';

import { IterableList, makeGraphqlIterator } from './makeGraphqlIterator';

Expand Down Expand Up @@ -52,6 +52,7 @@ export const listBranchProtectionRules = async (
const branchProtectionRules: BranchProtectionRule[] = [];

for await (const node of iterator) {
// eslint-disable-next-line functional/immutable-data
branchProtectionRules.push(node);
}

Expand Down
3 changes: 1 addition & 2 deletions src/common/makeGraphqlIterator.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint-disable immutable/no-let */
/* eslint-disable no-await-in-loop */
/* eslint-disable prefer-destructuring */

import { getOctokit } from '@actions/github';
import { GraphQlQueryResponseData } from '@octokit/graphql';
import type { GraphQlQueryResponseData } from '@octokit/graphql';

const MAX_PAGE_SIZE = 100;

Expand Down
2 changes: 2 additions & 0 deletions src/common/merge.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ describe('merge', (): void => {
it('does not log any warnings if last commit was not created by the selected GITHUB_LOGIN and ENABLED_FOR_MANUAL_CHANGES is set to "true"', async (): Promise<void> => {
expect.assertions(1);

/* eslint-disable jest/no-conditional-in-test */
getInputSpy.mockImplementation((name: string): string => {
if (name === 'ENABLED_FOR_MANUAL_CHANGES') {
return 'true';
Expand All @@ -618,6 +619,7 @@ describe('merge', (): void => {

return '';
});
/* eslint-enable jest/no-conditional-in-test */

const pullRequestInformation: PullRequestInformation = {
authorLogin: 'dependabot',
Expand Down
8 changes: 4 additions & 4 deletions src/eventHandlers/continuousIntegrationEnd/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ describe('continuous integration end event handler', (): void => {

const { check_suite: checkSuite, eventName } = context.payload;

/* eslint-disable immutable/no-mutation */
/* eslint-disable functional/immutable-data */
context.eventName = 'workflow_run';
context.payload.workflow_run = checkSuite;
delete context.payload.check_suite;
/* eslint-enable immutable/no-mutation */
/* eslint-enable functional/immutable-data */

nock('https://api.github.com')
.post('/graphql')
Expand All @@ -153,12 +153,12 @@ describe('continuous integration end event handler', (): void => {
await continuousIntegrationEndHandle(octokit, DEPENDABOT_GITHUB_LOGIN, 3);

/* eslint-disable require-atomic-updates */
/* eslint-disable immutable/no-mutation */
/* eslint-disable functional/immutable-data */
context.eventName = eventName;
context.payload.check_suite = checkSuite;
delete context.payload.workflow_run;
/* eslint-enable require-atomic-updates */
/* eslint-enable immutable/no-mutation */
/* eslint-enable functional/immutable-data */

expect(warningSpy).toHaveBeenCalledWith(
'Unable to fetch pull request information.',
Expand Down
34 changes: 15 additions & 19 deletions src/eventHandlers/continuousIntegrationEnd/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,26 +90,21 @@ export const continuousIntegrationEndHandle = async (
pullRequests.map(({ base }: PullRequest): string => base.ref),
);

const pullRequestsInformationPromises: Array<
Promise<PullRequestInformation | undefined>
> = [];

for (const pullRequest of pullRequests) {
pullRequestsInformationPromises.push(
getMergeablePullRequestInformationWithRetry(
octokit,
{
pullRequestNumber: pullRequest.number,
repositoryName: context.repo.repo,
repositoryOwner: context.repo.owner,
},
{ maximum: maximumRetries },
).catch((): undefined => undefined),
);
}

const pullRequestsInformation = await Promise.all(
pullRequestsInformationPromises,
pullRequests.map(
async (
pullRequest: PullRequest,
): Promise<PullRequestInformation | undefined> =>
getMergeablePullRequestInformationWithRetry(
octokit,
{
pullRequestNumber: pullRequest.number,
repositoryName: context.repo.repo,
repositoryOwner: context.repo.owner,
},
{ maximum: maximumRetries },
).catch((): undefined => undefined),
),
);

const mergePromises: Array<Promise<void>> = [];
Expand All @@ -127,6 +122,7 @@ export const continuousIntegrationEndHandle = async (
)}.`,
);

// eslint-disable-next-line functional/immutable-data
mergePromises.push(
tryMerge(
octokit,
Expand Down
5 changes: 3 additions & 2 deletions src/eventHandlers/pullRequest/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,16 @@ describe('pull request event handler', (): void => {
expect.assertions(0);

const { pull_request: pullRequest } = context.payload;
// eslint-disable-next-line functional/immutable-data
delete context.payload.pull_request;

await pullRequestHandle(octokit, DEPENDABOT_GITHUB_LOGIN, 2);

/* eslint-disable require-atomic-updates */
/* eslint-disable immutable/no-mutation */
/* eslint-disable functional/immutable-data */
context.payload.pull_request = pullRequest;
/* eslint-enable require-atomic-updates */
/* eslint-enable immutable/no-mutation */
/* eslint-enable functional/immutable-data */
});

it('logs a warning when it cannot find pull request ID by pull request number (null)', async (): Promise<void> => {
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const main = async (): Promise<void> => {
}
};

// eslint-disable-next-line unicorn/prefer-top-level-await
main().catch((error: Error): void => {
setFailed(
`An unexpected error occurred: ${error.message}, ${
Expand Down
4 changes: 2 additions & 2 deletions src/utilities/inputParsers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ describe('parseInputMergeMethod', (): void => {

getInputSpy.mockReturnValueOnce('OTHER');

expect<unknown>(parseInputMergeMethod()).toStrictEqual('SQUASH');
expect<unknown>(parseInputMergeMethod()).toBe('SQUASH');
});

it('returns undefined if merge method is not provided', (): void => {
expect.assertions(1);

getInputSpy.mockReturnValueOnce('');

expect<unknown>(parseInputMergeMethod()).toStrictEqual('SQUASH');
expect<unknown>(parseInputMergeMethod()).toBe('SQUASH');
});
});

Expand Down
3 changes: 2 additions & 1 deletion src/utilities/log.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ const errorSpy = jest.spyOn(core, 'error').mockImplementation();
const infoSpy = jest.spyOn(core, 'info').mockImplementation();
const warningSpy = jest.spyOn(core, 'warning').mockImplementation();

/* eslint-disable functional/immutable-data */
const errorWithoutStack = new Error('I am an error.');
delete errorWithoutStack.stack;

const errorWithStack = new Error('I am an error.');
/* eslint-disable-next-line immutable/no-mutation */
errorWithStack.stack = 'I am a stack.';
/* eslint-enable functional/immutable-data */

describe.each<
[
Expand Down
24 changes: 12 additions & 12 deletions src/utilities/prTitleParsers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('checkPullRequestTitleForMergePreset', (): void => {

parseInputMergePresetSpy.mockReturnValueOnce(undefined);

expect(checkPullRequestTitleForMergePreset('')).toStrictEqual(true);
expect(checkPullRequestTitleForMergePreset('')).toBe(true);
});

describe('given containing major bump', (): void => {
Expand All @@ -25,7 +25,7 @@ describe('checkPullRequestTitleForMergePreset', (): void => {

parseInputMergePresetSpy.mockReturnValueOnce(mergeCategory);

expect(checkPullRequestTitleForMergePreset(title)).toStrictEqual(false);
expect(checkPullRequestTitleForMergePreset(title)).toBe(false);
},
);
});
Expand All @@ -40,7 +40,7 @@ describe('checkPullRequestTitleForMergePreset', (): void => {

parseInputMergePresetSpy.mockReturnValueOnce(mergeCategory);

expect(checkPullRequestTitleForMergePreset(title)).toStrictEqual(false);
expect(checkPullRequestTitleForMergePreset(title)).toBe(false);
},
);
});
Expand All @@ -55,7 +55,7 @@ describe('checkPullRequestTitleForMergePreset', (): void => {
inputParsers.AllowedMergePresets.DEPENDABOT_MINOR,
);

expect(checkPullRequestTitleForMergePreset(title)).toStrictEqual(true);
expect(checkPullRequestTitleForMergePreset(title)).toBe(true);
});

it('returns false for DEPENDABOT_PATCH', (): void => {
Expand All @@ -65,7 +65,7 @@ describe('checkPullRequestTitleForMergePreset', (): void => {
inputParsers.AllowedMergePresets.DEPENDABOT_PATCH,
);

expect(checkPullRequestTitleForMergePreset(title)).toStrictEqual(false);
expect(checkPullRequestTitleForMergePreset(title)).toBe(false);
});
});

Expand All @@ -79,7 +79,7 @@ describe('checkPullRequestTitleForMergePreset', (): void => {
inputParsers.AllowedMergePresets.DEPENDABOT_MINOR,
);

expect(checkPullRequestTitleForMergePreset(title)).toStrictEqual(true);
expect(checkPullRequestTitleForMergePreset(title)).toBe(true);
});

it('returns false for DEPENDABOT_PATCH', (): void => {
Expand All @@ -89,7 +89,7 @@ describe('checkPullRequestTitleForMergePreset', (): void => {
inputParsers.AllowedMergePresets.DEPENDABOT_PATCH,
);

expect(checkPullRequestTitleForMergePreset(title)).toStrictEqual(false);
expect(checkPullRequestTitleForMergePreset(title)).toBe(false);
});
});

Expand All @@ -103,7 +103,7 @@ describe('checkPullRequestTitleForMergePreset', (): void => {

parseInputMergePresetSpy.mockReturnValueOnce(mergeCategory);

expect(checkPullRequestTitleForMergePreset(title)).toStrictEqual(true);
expect(checkPullRequestTitleForMergePreset(title)).toBe(true);
},
);
});
Expand All @@ -118,7 +118,7 @@ describe('checkPullRequestTitleForMergePreset', (): void => {

parseInputMergePresetSpy.mockReturnValueOnce(mergeCategory);

expect(checkPullRequestTitleForMergePreset(title)).toStrictEqual(true);
expect(checkPullRequestTitleForMergePreset(title)).toBe(true);
},
);
});
Expand All @@ -133,7 +133,7 @@ describe('checkPullRequestTitleForMergePreset', (): void => {

parseInputMergePresetSpy.mockReturnValueOnce(mergeCategory);

expect(checkPullRequestTitleForMergePreset(title)).toStrictEqual(true);
expect(checkPullRequestTitleForMergePreset(title)).toBe(true);
},
);
});
Expand All @@ -148,7 +148,7 @@ describe('checkPullRequestTitleForMergePreset', (): void => {

parseInputMergePresetSpy.mockReturnValueOnce(mergeCategory);

expect(checkPullRequestTitleForMergePreset(title)).toStrictEqual(true);
expect(checkPullRequestTitleForMergePreset(title)).toBe(true);
},
);
});
Expand All @@ -163,7 +163,7 @@ describe('checkPullRequestTitleForMergePreset', (): void => {

parseInputMergePresetSpy.mockReturnValueOnce(mergeCategory);

expect(checkPullRequestTitleForMergePreset(title)).toStrictEqual(false);
expect(checkPullRequestTitleForMergePreset(title)).toBe(false);
},
);
});
Expand Down

0 comments on commit 1ea3ca2

Please sign in to comment.