Fully working with the rule no explicit any

This commit is contained in:
2020-11-25 09:27:42 +05:30
parent 84535ca9bb
commit b583b90756
27 changed files with 223 additions and 155 deletions

View File

@ -3,9 +3,8 @@ import { Product } from './product';
import { Tax } from './tax';
export class BillViewItem {
id: string;
id: string | undefined;
isKot: boolean;
oldKot: boolean;
info: string;
kotId: string;
@ -20,10 +19,16 @@ export class BillViewItem {
tax: Tax;
modifiers: Modifier[];
public get isOldKot(): boolean {
return this.isKot && this.id !== undefined;
}
public get isNewKot(): boolean {
return this.isKot && this.id === undefined;
}
public constructor(init?: Partial<BillViewItem>) {
this.id = '';
this.isKot = true;
this.oldKot = false;
this.info = '';
this.kotId = '';
this.product = new Product();

View File

@ -19,7 +19,7 @@ export class ErrorLoggerService {
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this
public handleError<T>(serviceName = 'error-logger', operation = 'operation', result?: T) {
return (error: any): Observable<T> => {
return (error: unknown): Observable<T> => {
ErrorLoggerService.log(serviceName, `${operation} failed: ${error}`);
return throwError(error);
};

View File

@ -19,7 +19,7 @@ export class ErrorInterceptor implements HttpInterceptor {
private toaster: ToasterService,
) {}
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
return next.handle(request).pipe(
catchError((err) => {
// We don't want to refresh token for some requests like login or refresh token itself

View File

@ -10,7 +10,7 @@ export class JwtInterceptor implements HttpInterceptor {
constructor(private authService: AuthService) {}
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
// add authorization header with jwt token if available
// We use this line to debug token refreshing