Skip to content

Commit

Permalink
update dev dependencies and react to new linting rules (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsciple committed Oct 19, 2021
1 parent c49af7c commit eb8a193
Show file tree
Hide file tree
Showing 16 changed files with 15,655 additions and 5,382 deletions.
8 changes: 1 addition & 7 deletions .eslintrc.json
@@ -1,6 +1,6 @@
{
"plugins": ["jest", "@typescript-eslint"],
"extends": ["plugin:github/es6"],
"extends": ["plugin:github/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
Expand All @@ -16,13 +16,9 @@
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-ignore": "error",
"camelcase": "off",
"@typescript-eslint/camelcase": "error",
"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
"@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-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
Expand All @@ -33,15 +29,13 @@
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-object-literal-type-assertion": "error",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-interface": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
Expand Down
8 changes: 4 additions & 4 deletions __test__/git-auth-helper.test.ts
Expand Up @@ -417,7 +417,7 @@ describe('git-auth-helper tests', () => {
`Did not expect file to exist: '${globalGitConfigPath}'`
)
} catch (err) {
if (err.code !== 'ENOENT') {
if ((err as any)?.code !== 'ENOENT') {
throw err
}
}
Expand Down Expand Up @@ -601,7 +601,7 @@ describe('git-auth-helper tests', () => {
await fs.promises.stat(actualKeyPath)
throw new Error('SSH key should have been deleted')
} catch (err) {
if (err.code !== 'ENOENT') {
if ((err as any)?.code !== 'ENOENT') {
throw err
}
}
Expand All @@ -611,7 +611,7 @@ describe('git-auth-helper tests', () => {
await fs.promises.stat(actualKnownHostsPath)
throw new Error('SSH known hosts should have been deleted')
} catch (err) {
if (err.code !== 'ENOENT') {
if ((err as any)?.code !== 'ENOENT') {
throw err
}
}
Expand Down Expand Up @@ -658,7 +658,7 @@ describe('git-auth-helper tests', () => {
await fs.promises.stat(homeOverride)
throw new Error(`Should have been deleted '${homeOverride}'`)
} catch (err) {
if (err.code !== 'ENOENT') {
if ((err as any)?.code !== 'ENOENT') {
throw err
}
}
Expand Down
8 changes: 5 additions & 3 deletions __test__/ref-helper.test.ts
Expand Up @@ -16,7 +16,7 @@ describe('ref-helper tests', () => {
await refHelper.getCheckoutInfo(git, 'refs/heads/my/branch', commit)
throw new Error('Should not reach here')
} catch (err) {
expect(err.message).toBe('Arg git cannot be empty')
expect((err as any)?.message).toBe('Arg git cannot be empty')
}
})

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

Expand Down Expand Up @@ -102,7 +104,7 @@ describe('ref-helper tests', () => {
await refHelper.getCheckoutInfo(git, 'my-ref', '')
throw new Error('Should not reach here')
} catch (err) {
expect(err.message).toBe(
expect((err as any)?.message).toBe(
"A branch or tag with the name 'my-ref' could not be found"
)
}
Expand Down
2 changes: 1 addition & 1 deletion __test__/retry-helper.test.ts
Expand Up @@ -74,7 +74,7 @@ describe('retry-helper tests', () => {
throw new Error(`some error ${++attempts}`)
})
} catch (err) {
error = err
error = err as Error
}
expect(error.message).toBe('some error 3')
expect(attempts).toBe(3)
Expand Down

0 comments on commit eb8a193

Please sign in to comment.