From a90374bb6af64b089b31678e89b21486deaa5c81 Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Mon, 12 Oct 2020 16:39:01 -0700 Subject: [PATCH 1/6] Disable lint rule no-use-before-define --- .eslintrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index 6543c18..c4afa77 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -82,7 +82,7 @@ "no-unneeded-ternary": "error", "no-unused-expressions": "error", "no-unused-vars": "off", // Needs to be disabled for @typescript/no-unused-vars to work - "no-use-before-define": "error", + "no-use-before-define": "off", "no-useless-call": "error", "no-useless-concat": "error", "no-with": "error", From 9256e280be352dbf694babdb4467328020ce03df Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Mon, 12 Oct 2020 16:39:59 -0700 Subject: [PATCH 2/6] Avoid using object, to make lint happy --- src/dependency-details-retriever.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dependency-details-retriever.ts b/src/dependency-details-retriever.ts index bc7dcd0..41700c2 100644 --- a/src/dependency-details-retriever.ts +++ b/src/dependency-details-retriever.ts @@ -188,8 +188,8 @@ class RestfulLanguageAndIssuesDataFetcher extends BaseRestfulGithubDataFetcher< } } -class RestfulLabelDataFetcher extends BaseRestfulGithubDataFetcher { - public executeRequest(params: RequestParams): Promise { +class RestfulLabelDataFetcher extends BaseRestfulGithubDataFetcher[]> { + public executeRequest(params: RequestParams): Promise[]> { const requestUrl = `${this.getURL(params)}/issues?since=${MIN_ISSUE_DATE}&labels=${ params.label }`; From 54d42691698dcc7daa6c778a361c901eb7e4629a Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Mon, 12 Oct 2020 16:46:47 -0700 Subject: [PATCH 3/6] Reformat a line to make it more lint-friendly --- src/dependency-details-retriever.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dependency-details-retriever.ts b/src/dependency-details-retriever.ts index 41700c2..4f063d4 100644 --- a/src/dependency-details-retriever.ts +++ b/src/dependency-details-retriever.ts @@ -190,9 +190,10 @@ class RestfulLanguageAndIssuesDataFetcher extends BaseRestfulGithubDataFetcher< class RestfulLabelDataFetcher extends BaseRestfulGithubDataFetcher[]> { public executeRequest(params: RequestParams): Promise[]> { - const requestUrl = `${this.getURL(params)}/issues?since=${MIN_ISSUE_DATE}&labels=${ - params.label - }`; + const requestUrl = + `${this.getURL(params)}/issues?` + + `since=${MIN_ISSUE_DATE}&` + + `labels=${params.label}`; TabDepthLogger.info(2, `Querying: ${requestUrl}`); return this.httpClient From ab36f3c8f4479331a51b06da270e043603cbeb4c Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Mon, 12 Oct 2020 16:49:04 -0700 Subject: [PATCH 4/6] Delete lint overrides for obsolete rules --- src/dependency-details-retriever.ts | 5 ----- src/owner-data-collection.ts | 7 ------- 2 files changed, 12 deletions(-) diff --git a/src/dependency-details-retriever.ts b/src/dependency-details-retriever.ts index 4f063d4..78e099f 100644 --- a/src/dependency-details-retriever.ts +++ b/src/dependency-details-retriever.ts @@ -75,7 +75,6 @@ class RestfulOwnersDataFetcher extends BaseRestfulGithubDataFetcher { - // eslint-disable-next-line @typescript-eslint/camelcase ownerData.funding_url = fundingUrl; return ownerData; @@ -110,10 +109,8 @@ class RestfulDependenciesDataFetcher extends BaseRestfulGithubDataFetcher { repoData.language = languageAndOpenIssuesCount.language; - // eslint-disable-next-line @typescript-eslint/camelcase repoData.open_issues_count = languageAndOpenIssuesCount.openIssuesCount; return repoData; @@ -233,7 +229,6 @@ class RestfulLabelDataFetcher extends BaseRestfulGithubDataFetcher Date: Mon, 12 Oct 2020 16:50:16 -0700 Subject: [PATCH 5/6] Fix a prettier complaint about indenting --- src/gitHubIssueFetcher.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gitHubIssueFetcher.ts b/src/gitHubIssueFetcher.ts index f2a4e1f..65e93bb 100644 --- a/src/gitHubIssueFetcher.ts +++ b/src/gitHubIssueFetcher.ts @@ -168,7 +168,7 @@ export class GitHubIssueFetcher { const issueCountsAndIssues = response.search; getLogger().info( `Fetched: ${queryId} => ` + - `${issueCountsAndIssues.edges.length}/${issueCountsAndIssues.issueCount} (${issueCountsAndIssues.pageInfo.hasNextPage})` + `${issueCountsAndIssues.edges.length}/${issueCountsAndIssues.issueCount} (${issueCountsAndIssues.pageInfo.hasNextPage})` ); const rateLimit = response.rateLimit; getLogger().info(`Rate limits: ${JSON.stringify(rateLimit)}`); From 229e66422f337e8820e02497af25c4e52a57a3c4 Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Mon, 12 Oct 2020 17:14:52 -0700 Subject: [PATCH 6/6] Remove tslint comments since we switched to eslint --- src/dependency-details-retriever.ts | 4 ---- src/owner-data-collection.ts | 2 -- src/request-queue.ts | 3 --- 3 files changed, 9 deletions(-) diff --git a/src/dependency-details-retriever.ts b/src/dependency-details-retriever.ts index 78e099f..e178faf 100644 --- a/src/dependency-details-retriever.ts +++ b/src/dependency-details-retriever.ts @@ -18,7 +18,6 @@ abstract class BaseRestfulGithubDataFetcher extends DataFetcher { this.httpClient = httpClient; } - // tslint:disable-next-line: no-any // eslint-disable-next-line @typescript-eslint/no-explicit-any protected extractFundingUrl(responseJson: any, requestUrl: string): string | null { if (Array.isArray(responseJson)) { @@ -33,7 +32,6 @@ abstract class BaseRestfulGithubDataFetcher extends DataFetcher { TabDepthLogger.error(0, errorMessage); } - // tslint:disable-next-line: no-null-keyword return null; } protected createErrorMessage(err: Error, requestUrl: string): string { @@ -110,7 +108,6 @@ class RestfulDependenciesDataFetcher extends BaseRestfulGithubDataFetcher; - // tslint:disable-next-line: no-any constructor(requestParams: RequestParams, dataFetcher: DataFetcher) { this.requestParams = requestParams; this.dataFetcher = dataFetcher; @@ -17,7 +15,6 @@ export class RequesteQueueEntry { export class RequestQueue { private readonly requestQueue: OrderedMap = new OrderedMap(); - // tslint:disable-next-line: no-any public queueRequest(requestParams: RequestParams, dataFetcher: DataFetcher): void { const key = this.createKeyFromParams(requestParams); this.requestQueue.add(key, new RequesteQueueEntry(requestParams, dataFetcher));