Add lint rule banning wildcard imports. Fix existing ones where possible.

This commit is contained in:
Tim Donohue
2022-10-14 16:10:01 -05:00
parent ea00bda9e3
commit d66fdf42b1
29 changed files with 73 additions and 56 deletions

View File

@@ -1,6 +1,6 @@
import { TranslateLoader } from '@ngx-translate/core';
import { Observable, of as observableOf } from 'rxjs';
import * as fs from 'fs';
import { readFileSync } from 'fs';
import { TransferState } from '@angular/platform-browser';
import { NGX_TRANSLATE_STATE, NgxTranslateState } from './ngx-translate-state';
@@ -24,7 +24,7 @@ export class TranslateServerLoader implements TranslateLoader {
*/
public getTranslation(lang: string): Observable<any> {
// Retrieve the file for the given language, and parse it
const messages = JSON.parse(fs.readFileSync(`${this.prefix}${lang}${this.suffix}`, 'utf8'));
const messages = JSON.parse(readFileSync(`${this.prefix}${lang}${this.suffix}`, 'utf8'));
// Store the parsed messages in the transfer state so they'll be available immediately when the
// app loads on the client
this.storeInTransferState(lang, messages);