Skip to content

Commit

Permalink
Merge pull request #11293 from qmonmert/angeslint1
Browse files Browse the repository at this point in the history
Angular/ESLint: activate use-unknown-in-catch-callback-variable rule
  • Loading branch information
murdos authored Nov 4, 2024
2 parents 36cbda0 + a74b539 commit b329294
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export default tseslint.config(
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
'@typescript-eslint/restrict-template-expressions': ['error', { allowNumber: true }],
'arrow-body-style': 'error',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ bootstrapApplication(AppComponent, {
importProvidersFrom([BrowserAnimationsModule]),
{ provide: REMOVE_STYLES_ON_COMPONENT_DESTROY, useValue: true },
],
}).catch(err => console.error(err));
}).catch((err: unknown) => console.error(err));
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ describe('Oauth2 Auth Service', () => {
expect(keycloakInstance.updateToken).toHaveBeenCalledWith(70);
await expect(updateTokenPromise).rejects.toEqual(new Error('unknown error'));
expect(console.error).toHaveBeenCalledWith('Failed to refresh token: Error: unknown error');
expect(console.error).toHaveBeenCalledWith('Failed to refresh token', new Error('unknown error'));
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ export class Oauth2AuthService {
console.debug(`Token not refreshed, valid for ${Math.round(exp + timeSkew - Date.now() / 1000)} seconds`);
}
})
.catch(e => console.error(`Failed to refresh token: ${e}`));
.catch((e: unknown) => console.error('Failed to refresh token', e));
}
}
2 changes: 1 addition & 1 deletion src/test/resources/projects/angular/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ bootstrapApplication(AppComponent, {
importProvidersFrom([BrowserAnimationsModule]),
{ provide: REMOVE_STYLES_ON_COMPONENT_DESTROY, useValue: true },
],
}).catch(err => console.error(err));
}).catch((err: unknown) => console.error(err));

0 comments on commit b329294

Please sign in to comment.