Skip to content

Commit c57cef4

Browse files
Merge pull request #2431 from angular/fix-lint
chore(lint): Fix lint errors + Run lint pre-commit and In Travis
2 parents 3665a56 + 1a57717 commit c57cef4

File tree

96 files changed

+1949
-1670
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1949
-1670
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ branches:
1515

1616
install: yarn
1717

18-
script: yarn build && yarn test:all
18+
script: yarn build && yarn test:all && yarn lint

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
"build": "tsc tools/build.ts; node ./tools/build.js",
1717
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1"
1818
},
19+
"husky": {
20+
"hooks": {
21+
"pre-commit": "npm run lint"
22+
}
23+
},
1924
"schematics": "./dist/packages-dist/collection.json",
2025
"builders": "./dist/packages-dist/builders.json",
2126
"keywords": [
@@ -49,6 +54,7 @@
4954
"firebase-tools": "^8.0.0",
5055
"fs-extra": "^8.0.1",
5156
"fuzzy": "^0.1.3",
57+
"husky": "^4.2.5",
5258
"inquirer": "^6.2.2",
5359
"inquirer-autocomplete-prompt": "^1.0.1",
5460
"rxfire": "^3.9.7",

sample/server.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ import { APP_BASE_HREF } from '@angular/common';
99
import { existsSync } from 'fs';
1010

1111
// Polyfill XMLHttpRequest and WS for Firebase
12-
global['XMLHttpRequest'] = require("xhr2");
13-
global['WebSocket'] = require("ws");
12+
/* tslint:disable:no-string-literal */
13+
global['XMLHttpRequest'] = require('xhr2');
14+
global['WebSocket'] = require('ws');
15+
/* tslint:enable:no-string-literal */
1416

1517
// The Express app is exported so that it can be used by serverless Functions.
1618
export function app() {

sample/src/app/app-routing.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { NgModule } from '@angular/core';
2-
import { Routes, RouterModule } from '@angular/router';
2+
import { RouterModule, Routes } from '@angular/router';
33

44

55
const routes: Routes = [];

sample/src/app/app.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TestBed, async } from '@angular/core/testing';
1+
import { async, TestBed } from '@angular/core/testing';
22
import { RouterTestingModule } from '@angular/router/testing';
33
import { AppComponent } from './app.component';
44

sample/src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, ApplicationRef } from '@angular/core';
1+
import { ApplicationRef, Component } from '@angular/core';
22
import { FirebaseApp } from '@angular/fire';
33

44
@Component({

sample/src/app/app.module.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BrowserModule, BrowserTransferStateModule } from '@angular/platform-browser';
2-
import { NgModule, isDevMode } from '@angular/core';
2+
import { isDevMode, NgModule } from '@angular/core';
33

44
import { AppRoutingModule } from './app-routing.module';
55
import { AppComponent } from './app.component';
@@ -9,7 +9,12 @@ import { environment } from '../environments/environment';
99
import { AngularFireModule } from '@angular/fire';
1010
import { AngularFireStorageModule } from '@angular/fire/storage';
1111

12-
import { AngularFireAnalyticsModule, UserTrackingService, ScreenTrackingService, DEBUG_MODE as ANALYTICS_DEBUG_MODE } from '@angular/fire/analytics';
12+
import {
13+
AngularFireAnalyticsModule,
14+
DEBUG_MODE as ANALYTICS_DEBUG_MODE,
15+
ScreenTrackingService,
16+
UserTrackingService
17+
} from '@angular/fire/analytics';
1318

1419
import { FirestoreComponent } from './firestore/firestore.component';
1520

@@ -28,7 +33,7 @@ import { RemoteConfigComponent } from './remote-config/remote-config.component';
2833
const shouldUseEmulator = () => false;
2934

3035
@NgModule({
31-
declarations: [ AppComponent, StorageComponent, FirestoreComponent, DatabaseComponent, RemoteConfigComponent ],
36+
declarations: [AppComponent, StorageComponent, FirestoreComponent, DatabaseComponent, RemoteConfigComponent],
3237
imports: [
3338
BrowserModule.withServerTransition({ appId: 'serverApp' }),
3439
BrowserTransferStateModule,
@@ -50,12 +55,19 @@ const shouldUseEmulator = () => false;
5055
UserTrackingService,
5156
ScreenTrackingService,
5257
PerformanceMonitoringService,
53-
{ provide: ANALYTICS_DEBUG_MODE, useFactory: () => isDevMode() },
54-
{ provide: DATABASE_URL, useFactory: () => shouldUseEmulator() ? `http://localhost:9000?ns=${environment.firebase.projectId}` : undefined },
55-
{ provide: FIRESTORE_SETTINGS, useFactory: () => shouldUseEmulator() ? { host: 'localhost:8080', ssl: false } : {} },
56-
{ provide: FUNCTIONS_ORIGIN, useFactory: () => shouldUseEmulator() ? 'http://localhost:9999' : undefined },
58+
{
59+
provide: ANALYTICS_DEBUG_MODE,
60+
useFactory: () => isDevMode()
61+
},
62+
{
63+
provide: DATABASE_URL,
64+
useFactory: () => shouldUseEmulator() ? `http://localhost:9000?ns=${environment.firebase.projectId}` : undefined
65+
},
66+
{ provide: FIRESTORE_SETTINGS, useFactory: () => shouldUseEmulator() ? { host: 'localhost:8080', ssl: false } : {} },
67+
{ provide: FUNCTIONS_ORIGIN, useFactory: () => shouldUseEmulator() ? 'http://localhost:9999' : undefined },
5768
{ provide: REMOTE_CONFIG_SETTINGS, useFactory: () => isDevMode() ? { minimumFetchIntervalMillis: 10_000 } : {} }
5869
],
59-
bootstrap: [ AppComponent ]
70+
bootstrap: [AppComponent]
6071
})
61-
export class AppModule { }
72+
export class AppModule {
73+
}

sample/src/app/database/database.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, OnInit } from '@angular/core';
22
import { AngularFireDatabase } from '@angular/fire/database';
33
import { Observable } from 'rxjs';
4-
import { TransferState, makeStateKey } from '@angular/platform-browser';
4+
import { makeStateKey, TransferState } from '@angular/platform-browser';
55
import { startWith, tap } from 'rxjs/operators';
66
import { trace } from '@angular/fire/performance';
77

sample/src/app/firestore/firestore.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Component, OnInit } from '@angular/core';
22
import { AngularFirestore } from '@angular/fire/firestore';
33
import { Observable } from 'rxjs';
4-
import { tap, startWith } from 'rxjs/operators';
5-
import { TransferState, makeStateKey } from '@angular/platform-browser';
4+
import { startWith, tap } from 'rxjs/operators';
5+
import { makeStateKey, TransferState } from '@angular/platform-browser';
66
import { trace } from '@angular/fire/performance';
77

88
@Component({

sample/src/app/storage/storage.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ import { startWith, tap } from 'rxjs/operators';
55
import { makeStateKey, TransferState } from '@angular/platform-browser';
66
import { trace } from '@angular/fire/performance';
77

8-
const TRANSPARENT_PNG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='
8+
const TRANSPARENT_PNG
9+
= 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';
910

1011
@Component({
1112
selector: 'app-storage',
1213
template: `
1314
<p>
1415
Storage!
15-
<img [src]="downloadUrl$ | async" width="64" height="64" />
16+
<img [src]="downloadUrl$ | async" width="64" height="64"/>
1617
</p>
1718
`,
1819
styles: []

0 commit comments

Comments
 (0)