Skip to content

Commit 9964bc2

Browse files
committed
Fix the lint
1 parent 07105f4 commit 9964bc2

File tree

24 files changed

+60
-53
lines changed

24 files changed

+60
-53
lines changed

eslint.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,21 @@ module.exports = [
9696
"newlines-between": "never"
9797
},
9898
],
99+
'@angular-eslint/prefer-inject': 'off',
100+
'@typescript-eslint/no-empty-object-type': 'off',
101+
'import/named': 'off',
102+
"@typescript-eslint/no-unused-vars": [
103+
"error",
104+
{
105+
"argsIgnorePattern": "^_",
106+
"varsIgnorePattern": "^_",
107+
"caughtErrorsIgnorePattern": "^_",
108+
"ignoreRestSiblings": true
109+
}
110+
],
111+
"@typescript-eslint/prefer-promise-reject-errors": "off",
112+
"@typescript-eslint/no-require-imports": "off",
113+
"@typescript-eslint/ban-ts-comment": "warn",
99114
},
100115
},
101116
{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"test:all": "npm run test:node-esm && npm run test:chrome-headless && npm run test:typings && npm run test:build",
2121
"build": "rimraf dist && tspc -p tsconfig.build.json && node --trace-warnings ./tools/build.js && npm pack ./dist/packages-dist",
2222
"buildd": "tsc -p tsconfig.build.json && node --trace-warnings ./tools/build.js && npm pack ./dist/packages-dist",
23-
"build:jasmine": "npx tsc -p tsconfig.jasmine.json --module es2015 && cp ./dist/out-tsc/jasmine/tools/jasmine.js ./dist/out-tsc/jasmine/tools/jasmine.mjs && npx tsc -p tsconfig.jasmine.json && cp ./dist/packages-dist/schematics/versions.json ./dist/out-tsc/jasmine/schematics",
23+
"build:jasmine": "npx tsc -p tsconfig.jasmine.json --module es2015 && cp ./dist/out-tsc/jasmine/tools/jasmine.js ./dist/out-tsc/jasmine/tools/jasmine.mjs && npx tsc -p tsconfig.jasmine.json && cp ./dist/packages-dist/schematics/versions.json ./dist/out-tsc/jasmine/src/schematics",
2424
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1"
2525
},
2626
"husky": {

src/app/app.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ export function firebaseAppFactory(fn: (injector: Injector) => IFirebaseApp) {
6363
]
6464
})
6565
export class FirebaseAppModule {
66-
// eslint-disable-next-line @typescript-eslint/ban-types
6766
constructor(@Inject(PLATFORM_ID) platformId: object) {
6867
registerVersion('angularfire', VERSION.full, 'core');
6968
registerVersion('angularfire', VERSION.full, 'app');

src/compat/analytics/analytics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class AngularFireAnalytics {
4949
@Optional() @Inject(APP_NAME) providedAppName: string | null,
5050
@Optional() @Inject(DEBUG_MODE) debugModeEnabled: boolean | null,
5151
@Optional() @Inject(CONFIG) providedConfig: Config | null,
52-
// eslint-disable-next-line @typescript-eslint/ban-types
52+
5353
@Inject(PLATFORM_ID) platformId: object,
5454
zone: NgZone,
5555
schedulers: ɵAngularFireSchedulers,

src/compat/analytics/user-tracking.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class UserTrackingService implements OnDestroy {
1515
// TODO a user properties injector
1616
constructor(
1717
analytics: AngularFireAnalytics,
18-
// eslint-disable-next-line @typescript-eslint/ban-types
18+
1919
@Inject(PLATFORM_ID) platformId: object,
2020
auth: AngularFireAuth,
2121
zone: NgZone,

src/compat/angularfire2.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
import { CompilerFactory, DoBootstrap, NgModule, PlatformRef } from '@angular/core';
21
import { TestBed } from '@angular/core/testing';
32
import { ɵZoneScheduler } from '@angular/fire';
43
import { AngularFireModule, FirebaseApp } from '@angular/fire/compat';
5-
import { BrowserModule } from '@angular/platform-browser';
64
import { TestScheduler } from 'rxjs/testing';
75
import { COMMON_CONFIG } from '../../src/test-config';
86
import { rando } from '../../src/utils';
97

108
describe('angularfire', () => {
119
let app: FirebaseApp;
12-
let defaultPlatform: PlatformRef;
1310
let appName: string;
1411

1512
beforeEach(() => {
@@ -21,7 +18,6 @@ describe('angularfire', () => {
2118
});
2219

2320
app = TestBed.inject(FirebaseApp);
24-
defaultPlatform = TestBed.inject(PlatformRef);
2521
});
2622

2723
describe('ZoneScheduler', () => {

src/compat/auth/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class AngularFireAuth {
8787
constructor(
8888
@Inject(FIREBASE_OPTIONS) options: FirebaseOptions,
8989
@Optional() @Inject(FIREBASE_APP_NAME) name: string|null|undefined,
90-
// eslint-disable-next-line @typescript-eslint/ban-types
90+
9191
@Inject(PLATFORM_ID) platformId: object,
9292
zone: NgZone,
9393
schedulers: ɵAngularFireSchedulers,

src/compat/database/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class AngularFireDatabase {
3737
@Inject(FIREBASE_OPTIONS) options: FirebaseOptions,
3838
@Optional() @Inject(FIREBASE_APP_NAME) name: string | null | undefined,
3939
@Optional() @Inject(URL) databaseURL: string | null,
40-
// eslint-disable-next-line @typescript-eslint/ban-types
40+
4141
@Inject(PLATFORM_ID) platformId: object,
4242
zone: NgZone,
4343
public schedulers: ɵAngularFireSchedulers,

src/compat/database/list/create-reference.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function createListReference<T= any>(query: DatabaseQuery, afDatabase: An
3232
const snapshotChanges$ = snapshotChanges<T>(query, events, outsideAngularScheduler);
3333
return snapshotChanges$.pipe(
3434
map(actions => actions.map(a => {
35-
if (options && options.idField) {
35+
if (options?.idField) {
3636
return {
3737
...a.payload.val() as T,
3838
...{

src/compat/firebase.app.module.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function ɵfirebaseAppFactory(options: FirebaseOptions, zone: NgZone, nam
1515
const config = typeof nameOrConfig === 'object' && nameOrConfig || {};
1616
config.name = config.name || name;
1717
// Added any due to some inconsistency between @firebase/app and firebase types
18-
const existingApp = firebase.apps.filter(app => app && app.name === config.name)[0];
18+
const existingApp = firebase.apps.find(app => app && app.name === config.name);
1919
// We support FirebaseConfig, initializeApp's public type only accepts string; need to cast as any
2020
// Could be solved with https://github.com/firebase/firebase-js-sdk/pull/1206
2121
const app = (existingApp || zone.runOutsideAngular(() => firebase.initializeApp(options, config as any)));
@@ -24,11 +24,11 @@ export function ɵfirebaseAppFactory(options: FirebaseOptions, zone: NgZone, nam
2424
const hmr = !!(module as any).hot;
2525
log('error', `${app.name} Firebase App already initialized with different options${hmr ? ', you may need to reload as Firebase is not HMR aware.' : '.'}`);
2626
}
27-
} catch (e) { /* empty */ }
27+
} catch (_) { /* empty */ }
2828
return new FirebaseApp(app);
2929
}
3030

31-
const log = (level: 'log'|'error'|'info'|'warn', ...args: any) => {
31+
const log = (level: 'log' | 'error' | 'info' | 'warn', ...args: any) => {
3232
if (isDevMode() && typeof console !== 'undefined') {
3333
// eslint-disable-next-line no-console
3434
console[level](...args);
@@ -53,13 +53,12 @@ export class AngularFireModule {
5353
return {
5454
ngModule: AngularFireModule,
5555
providers: [
56-
{provide: FIREBASE_OPTIONS, useValue: options},
57-
{provide: FIREBASE_APP_NAME, useValue: nameOrConfig}
56+
{ provide: FIREBASE_OPTIONS, useValue: options },
57+
{ provide: FIREBASE_APP_NAME, useValue: nameOrConfig }
5858
]
5959
};
6060
}
6161

62-
// eslint-disable-next-line @typescript-eslint/ban-types
6362
constructor(@Inject(PLATFORM_ID) platformId: object) {
6463
firebase.registerVersion('angularfire', VERSION.full, 'core');
6564
firebase.registerVersion('angularfire', VERSION.full, 'app-compat');

0 commit comments

Comments
 (0)