upgrade eslint and fix breaking changes

This commit is contained in:
Namrata Jha
2022-02-15 13:52:11 +00:00
committed by GitHub
parent d6bf5f6a97
commit 5263253279
7 changed files with 9028 additions and 11020 deletions

View File

@@ -1,6 +1,6 @@
{ {
"plugins": ["jest", "@typescript-eslint"], "plugins": ["jest", "@typescript-eslint"],
"extends": ["plugin:github/es6"], "extends": ["plugin:github/recommended","plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser", "parser": "@typescript-eslint/parser",
"parserOptions": { "parserOptions": {
"ecmaVersion": 9, "ecmaVersion": 9,
@@ -17,13 +17,29 @@
"@typescript-eslint/no-require-imports": "error", "@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error", "@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error", "@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-ignore": "error", "@typescript-eslint/ban-ts-comment": "error",
"camelcase": "off", "camelcase": "off",
"@typescript-eslint/camelcase": "error", "@typescript-eslint/naming-convention": [
"@typescript-eslint/class-name-casing": "error", "error",
{
"selector": "class",
"format": ["PascalCase"]
},
{
"selector": "interface",
"format": ["PascalCase"]
},
{
"selector": "typeProperty",
"format": [],
"custom": {
"regex": "^[A-Z][A-Za-z]*$",
"match": false
}
}
],
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}], "@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
"@typescript-eslint/func-call-spacing": ["error", "never"], "@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/generic-type-naming": ["error", "^[A-Z][A-Za-z]*$"],
"@typescript-eslint/no-array-constructor": "error", "@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error", "@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error", "@typescript-eslint/no-explicit-any": "error",
@@ -33,7 +49,7 @@
"@typescript-eslint/no-misused-new": "error", "@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error", "@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn", "@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-object-literal-type-assertion": "error", "@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/no-unnecessary-qualifier": "error", "@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error", "@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error", "@typescript-eslint/no-useless-constructor": "error",
@@ -41,7 +57,7 @@
"@typescript-eslint/prefer-for-of": "warn", "@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn", "@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error", "@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-interface": "error", "@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error", "@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error", "@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error", "@typescript-eslint/require-array-sort-compare": "error",
@@ -50,7 +66,10 @@
"@typescript-eslint/semi": ["error", "never"], "@typescript-eslint/semi": ["error", "never"],
"@typescript-eslint/type-annotation-spacing": "error", "@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error", "@typescript-eslint/unbound-method": "error",
"no-console": "off" "no-console": "off",
"import/no-unresolved": "off",
"sort-imports": "off",
"filenames/match-regex": "off"
}, },
"env": { "env": {
"node": true, "node": true,

13076
dist/index.js vendored

File diff suppressed because one or more lines are too long

6921
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -30,12 +30,12 @@
"rxjs": "^6.5.4" "rxjs": "^6.5.4"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^24.0.23", "@types/jest": "^27.4.0",
"@types/node": "^12.7.12", "@types/node": "^12.7.12",
"@typescript-eslint/parser": "^2.8.0", "@typescript-eslint/parser": "^2.8.0",
"@vercel/ncc": "^0.31.1", "@vercel/ncc": "^0.31.1",
"eslint": "^5.16.0", "eslint": "^8.9.0",
"eslint-plugin-github": "^2.0.0", "eslint-plugin-github": "^4.3.5",
"eslint-plugin-jest": "^22.21.0", "eslint-plugin-jest": "^22.21.0",
"jest": "^27.3.1", "jest": "^27.3.1",
"jest-circus": "^27.3.1", "jest-circus": "^27.3.1",

View File

@@ -1,3 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import {from, Observable, merge, throwError, of} from 'rxjs' import {from, Observable, merge, throwError, of} from 'rxjs'
import {catchError, map, tap} from 'rxjs/operators' import {catchError, map, tap} from 'rxjs/operators'
import {graphql} from './graphql' import {graphql} from './graphql'

View File

@@ -1,4 +1,6 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import {GraphQlQueryResponse} from '@octokit/graphql/dist-types/types' import {GraphQlQueryResponse} from '@octokit/graphql/dist-types/types'
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import {Observable, from, throwError} from 'rxjs' import {Observable, from, throwError} from 'rxjs'
import {catchError, map} from 'rxjs/operators' import {catchError, map} from 'rxjs/operators'
import {graphql} from './graphql' import {graphql} from './graphql'
@@ -107,7 +109,7 @@ export function queryForOldestVersions(
} }
}) as Promise<GetVersionsQueryResponse> }) as Promise<GetVersionsQueryResponse>
).pipe( ).pipe(
catchError((err: GraphQlQueryResponse) => { catchError((err: GraphQlQueryResponse<unknown>) => {
const msg = 'query for oldest version failed.' const msg = 'query for oldest version failed.'
return throwError( return throwError(
err.errors && err.errors.length > 0 err.errors && err.errors.length > 0
@@ -129,7 +131,7 @@ export function queryForOldestVersions(
} }
}) as Promise<GetVersionsQueryResponse> }) as Promise<GetVersionsQueryResponse>
).pipe( ).pipe(
catchError((err: GraphQlQueryResponse) => { catchError((err: GraphQlQueryResponse<unknown>) => {
const msg = 'query for oldest version failed.' const msg = 'query for oldest version failed.'
return throwError( return throwError(
err.errors && err.errors.length > 0 err.errors && err.errors.length > 0
@@ -164,7 +166,7 @@ export function getOldestVersions(
`package: ${packageName} not found for owner: ${owner} in repo: ${repo}` `package: ${packageName} not found for owner: ${owner} in repo: ${repo}`
) )
r = { r = {
versions: <VersionInfo[]>[], versions: [] as VersionInfo[],
cursor: '', cursor: '',
paginate: false, paginate: false,
totalCount: 0 totalCount: 0

View File

@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import {GitHub} from '@actions/github' import {GitHub} from '@actions/github'
import {GraphQlQueryResponseData} from '@octokit/graphql/dist-types/types' import {GraphQlQueryResponseData} from '@octokit/graphql/dist-types/types'
import {RequestParameters} from '@octokit/types/dist-types/RequestParameters' import {RequestParameters} from '@octokit/types/dist-types/RequestParameters'