Skip to content

Commit eb8a193

Browse files
authored
update dev dependencies and react to new linting rules (#611)
1 parent c49af7c commit eb8a193

16 files changed

+15655
-5382
lines changed

.eslintrc.json

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"plugins": ["jest", "@typescript-eslint"],
3-
"extends": ["plugin:github/es6"],
3+
"extends": ["plugin:github/recommended"],
44
"parser": "@typescript-eslint/parser",
55
"parserOptions": {
66
"ecmaVersion": 9,
@@ -16,13 +16,9 @@
1616
"@typescript-eslint/no-require-imports": "error",
1717
"@typescript-eslint/array-type": "error",
1818
"@typescript-eslint/await-thenable": "error",
19-
"@typescript-eslint/ban-ts-ignore": "error",
2019
"camelcase": "off",
21-
"@typescript-eslint/camelcase": "error",
22-
"@typescript-eslint/class-name-casing": "error",
2320
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
2421
"@typescript-eslint/func-call-spacing": ["error", "never"],
25-
"@typescript-eslint/generic-type-naming": ["error", "^[A-Z][A-Za-z]*$"],
2622
"@typescript-eslint/no-array-constructor": "error",
2723
"@typescript-eslint/no-empty-interface": "error",
2824
"@typescript-eslint/no-explicit-any": "error",
@@ -33,15 +29,13 @@
3329
"@typescript-eslint/no-misused-new": "error",
3430
"@typescript-eslint/no-namespace": "error",
3531
"@typescript-eslint/no-non-null-assertion": "warn",
36-
"@typescript-eslint/no-object-literal-type-assertion": "error",
3732
"@typescript-eslint/no-unnecessary-qualifier": "error",
3833
"@typescript-eslint/no-unnecessary-type-assertion": "error",
3934
"@typescript-eslint/no-useless-constructor": "error",
4035
"@typescript-eslint/no-var-requires": "error",
4136
"@typescript-eslint/prefer-for-of": "warn",
4237
"@typescript-eslint/prefer-function-type": "warn",
4338
"@typescript-eslint/prefer-includes": "error",
44-
"@typescript-eslint/prefer-interface": "error",
4539
"@typescript-eslint/prefer-string-starts-ends-with": "error",
4640
"@typescript-eslint/promise-function-async": "error",
4741
"@typescript-eslint/require-array-sort-compare": "error",

__test__/git-auth-helper.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ describe('git-auth-helper tests', () => {
417417
`Did not expect file to exist: '${globalGitConfigPath}'`
418418
)
419419
} catch (err) {
420-
if (err.code !== 'ENOENT') {
420+
if ((err as any)?.code !== 'ENOENT') {
421421
throw err
422422
}
423423
}
@@ -601,7 +601,7 @@ describe('git-auth-helper tests', () => {
601601
await fs.promises.stat(actualKeyPath)
602602
throw new Error('SSH key should have been deleted')
603603
} catch (err) {
604-
if (err.code !== 'ENOENT') {
604+
if ((err as any)?.code !== 'ENOENT') {
605605
throw err
606606
}
607607
}
@@ -611,7 +611,7 @@ describe('git-auth-helper tests', () => {
611611
await fs.promises.stat(actualKnownHostsPath)
612612
throw new Error('SSH known hosts should have been deleted')
613613
} catch (err) {
614-
if (err.code !== 'ENOENT') {
614+
if ((err as any)?.code !== 'ENOENT') {
615615
throw err
616616
}
617617
}
@@ -658,7 +658,7 @@ describe('git-auth-helper tests', () => {
658658
await fs.promises.stat(homeOverride)
659659
throw new Error(`Should have been deleted '${homeOverride}'`)
660660
} catch (err) {
661-
if (err.code !== 'ENOENT') {
661+
if ((err as any)?.code !== 'ENOENT') {
662662
throw err
663663
}
664664
}

__test__/ref-helper.test.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('ref-helper tests', () => {
1616
await refHelper.getCheckoutInfo(git, 'refs/heads/my/branch', commit)
1717
throw new Error('Should not reach here')
1818
} catch (err) {
19-
expect(err.message).toBe('Arg git cannot be empty')
19+
expect((err as any)?.message).toBe('Arg git cannot be empty')
2020
}
2121
})
2222

@@ -25,7 +25,9 @@ describe('ref-helper tests', () => {
2525
await refHelper.getCheckoutInfo(git, '', '')
2626
throw new Error('Should not reach here')
2727
} catch (err) {
28-
expect(err.message).toBe('Args ref and commit cannot both be empty')
28+
expect((err as any)?.message).toBe(
29+
'Args ref and commit cannot both be empty'
30+
)
2931
}
3032
})
3133

@@ -102,7 +104,7 @@ describe('ref-helper tests', () => {
102104
await refHelper.getCheckoutInfo(git, 'my-ref', '')
103105
throw new Error('Should not reach here')
104106
} catch (err) {
105-
expect(err.message).toBe(
107+
expect((err as any)?.message).toBe(
106108
"A branch or tag with the name 'my-ref' could not be found"
107109
)
108110
}

__test__/retry-helper.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe('retry-helper tests', () => {
7474
throw new Error(`some error ${++attempts}`)
7575
})
7676
} catch (err) {
77-
error = err
77+
error = err as Error
7878
}
7979
expect(error.message).toBe('some error 3')
8080
expect(attempts).toBe(3)

0 commit comments

Comments
 (0)