From 6c8770449b2f7bb2484a1b7802a59e6b0746ca24 Mon Sep 17 00:00:00 2001
From: Brandon Clayton <bclayton@usgs.gov>
Date: Tue, 30 Aug 2022 08:40:36 -0600
Subject: [PATCH] lint fix

---
 example/angular.json                  | 34 ++++++++++++++++++++++-----
 example/src/app/app.component.html    |  6 +++--
 example/src/app/app.component.spec.ts | 16 ++++++-------
 example/src/app/app.component.ts      | 31 ++++++++++++++----------
 example/src/app/app.module.ts         |  8 +++----
 example/src/app/app.service.ts        | 13 +++++-----
 example/src/main.ts                   | 10 ++++----
 example/src/test.ts                   | 12 ++++++----
 8 files changed, 82 insertions(+), 48 deletions(-)

diff --git a/example/angular.json b/example/angular.json
index dc17b87..52c50c0 100644
--- a/example/angular.json
+++ b/example/angular.json
@@ -22,10 +22,17 @@
             "main": "src/main.ts",
             "polyfills": "src/polyfills.ts",
             "tsConfig": "tsconfig.app.json",
-            "assets": ["src/favicon.ico", "src/assets"],
-            "styles": ["src/styles.scss"],
+            "assets": [
+              "src/favicon.ico",
+              "src/assets"
+            ],
+            "styles": [
+              "src/styles.scss"
+            ],
             "scripts": [],
-            "allowedCommonJsDependencies": ["@nshmp/disagg-d3"],
+            "allowedCommonJsDependencies": [
+              "@nshmp/disagg-d3"
+            ],
             "vendorChunk": true,
             "extractLicenses": false,
             "buildOptimizer": false,
@@ -88,8 +95,13 @@
             "polyfills": "src/polyfills.ts",
             "tsConfig": "tsconfig.spec.json",
             "karmaConfig": "karma.conf.js",
-            "assets": ["src/favicon.ico", "src/assets"],
-            "styles": ["src/styles.scss"],
+            "assets": [
+              "src/favicon.ico",
+              "src/assets"
+            ],
+            "styles": [
+              "src/styles.scss"
+            ],
             "scripts": []
           }
         },
@@ -104,12 +116,22 @@
               "devServerTarget": "example:serve:production"
             }
           }
+        },
+        "lint": {
+          "builder": "@angular-eslint/builder:lint",
+          "options": {
+            "lintFilePatterns": [
+              "src/**/*.ts",
+              "src/**/*.html"
+            ]
+          }
         }
       }
     }
   },
   "defaultProject": "example",
   "cli": {
-    "analytics": false
+    "analytics": false,
+    "defaultCollection": "@angular-eslint/schematics"
   }
 }
diff --git a/example/src/app/app.component.html b/example/src/app/app.component.html
index 9c03c4b..ceb531a 100644
--- a/example/src/app/app.component.html
+++ b/example/src/app/app.component.html
@@ -1,10 +1,12 @@
 <div class="container">
   <select name="Component" (change)="onComponentChange($event.target.value)">
-    <option *ngFor="let disagg of data.disaggs[0].data" [value]="disagg?.component">
+    <option
+      *ngFor="let disagg of data.disaggs[0].data"
+      [value]="disagg?.component"
+    >
       {{ disagg?.component }}
     </option>
   </select>
 
   <div #example></div>
 </div>
-
diff --git a/example/src/app/app.component.spec.ts b/example/src/app/app.component.spec.ts
index 1443a50..a375012 100644
--- a/example/src/app/app.component.spec.ts
+++ b/example/src/app/app.component.spec.ts
@@ -1,15 +1,13 @@
-import { TestBed, waitForAsync } from '@angular/core/testing';
+import {TestBed, waitForAsync} from '@angular/core/testing';
 
-import { AppComponent } from './app.component';
+import {AppComponent} from './app.component';
 
 describe('AppComponent', () => {
-  beforeEach(
-    waitForAsync(() => {
-      TestBed.configureTestingModule({
-        declarations: [AppComponent],
-      }).compileComponents();
-    })
-  );
+  beforeEach(waitForAsync(() => {
+    TestBed.configureTestingModule({
+      declarations: [AppComponent],
+    }).compileComponents();
+  }));
 
   it('should create the app', () => {
     const fixture = TestBed.createComponent(AppComponent);
diff --git a/example/src/app/app.component.ts b/example/src/app/app.component.ts
index 5531090..e45b49a 100644
--- a/example/src/app/app.component.ts
+++ b/example/src/app/app.component.ts
@@ -1,14 +1,18 @@
-import { AfterViewInit, Component, ElementRef, ViewChild } from '@angular/core';
-import { nshmpHaz} from '@ghsc/nshmp-web-utils';
-import { DisaggGraphView, Disaggregation, DisaggResponse } from '@nshmp/disagg-d3/src/disagg';
-import { Collection } from '@nshmp/disagg-d3/src/mvc';
+import {AfterViewInit, Component, ElementRef, ViewChild} from '@angular/core';
+import {nshmpHaz} from '@ghsc/nshmp-web-utils';
+import {
+  DisaggGraphView,
+  Disaggregation,
+  DisaggResponse,
+} from '@nshmp/disagg-d3/src/disagg';
+import {Collection} from '@nshmp/disagg-d3/src/mvc';
 
 import disagg from '../assets/disagg-response.json';
 
 @Component({
   selector: 'app-root',
-  templateUrl: './app.component.html',
   styleUrls: ['./app.component.scss'],
+  templateUrl: './app.component.html',
 })
 export class AppComponent implements AfterViewInit {
   title = 'Disaggregation';
@@ -23,19 +27,23 @@ export class AppComponent implements AfterViewInit {
 
   ngAfterViewInit(): void {
     const response = new DisaggResponse(this.data);
-    const disaggs = response.get<Collection<Disaggregation>>('disaggregations').data();
+    const disaggs = response
+      .get<Collection<Disaggregation>>('disaggregations')
+      .data();
     this.disaggCollection.addAll(disaggs);
     this.disaggCollection.select(this.disaggCollection.data()[0]);
 
     this.view = new DisaggGraphView({
-      el: this.el.nativeElement,
-      collection: this.disaggCollection,
       bounds: this.bounds(this.data),
+      collection: this.disaggCollection,
+      el: this.el.nativeElement,
     });
   }
 
-  bounds(data: nshmpHaz.disaggService.DisaggResponseData): number[][]{
-    const totalComponent = data.disaggs[0].data.find(d => d.component === 'Total');
+  bounds(data: nshmpHaz.disaggService.DisaggResponseData): number[][] {
+    const totalComponent = data.disaggs[0].data.find(
+      d => d.component === 'Total'
+    );
     return DisaggGraphView.calculateBounds(totalComponent.data);
   }
 
@@ -44,7 +52,6 @@ export class AppComponent implements AfterViewInit {
       .data()
       .find(d => d.get('component') === component);
 
-   this.disaggCollection.select(componentData);
+    this.disaggCollection.select(componentData);
   }
-
 }
diff --git a/example/src/app/app.module.ts b/example/src/app/app.module.ts
index 7bcb9e9..d78405f 100644
--- a/example/src/app/app.module.ts
+++ b/example/src/app/app.module.ts
@@ -1,12 +1,12 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
+import {NgModule} from '@angular/core';
+import {BrowserModule} from '@angular/platform-browser';
 
-import { AppComponent } from './app.component';
+import {AppComponent} from './app.component';
 
 @NgModule({
+  bootstrap: [AppComponent],
   declarations: [AppComponent],
   imports: [BrowserModule],
   providers: [],
-  bootstrap: [AppComponent],
 })
 export class AppModule {}
diff --git a/example/src/app/app.service.ts b/example/src/app/app.service.ts
index 167535a..7e5114d 100644
--- a/example/src/app/app.service.ts
+++ b/example/src/app/app.service.ts
@@ -1,14 +1,15 @@
-import { HttpClient } from '@angular/common/http';
-import { Injectable } from '@angular/core';
-import { nshmpHaz } from '@ghsc/nshmp-web-utils';
-import { Observable, throwError } from 'rxjs';
-import { map } from 'rxjs/operators';
+import {HttpClient} from '@angular/common/http';
+import {Injectable} from '@angular/core';
+import {nshmpHaz} from '@ghsc/nshmp-web-utils';
+import {Observable, throwError} from 'rxjs';
+import {map} from 'rxjs/operators';
 
 @Injectable({
   providedIn: 'root',
 })
 export class AppService {
-  url = 'https://earthquake.usgs.gov/nshmp-haz-ws/deagg/E2014B/COUS/-104/39/PGA/760/2475';
+  url =
+    'https://earthquake.usgs.gov/nshmp-haz-ws/deagg/E2014B/COUS/-104/39/PGA/760/2475';
 
   constructor(private http: HttpClient) {}
 
diff --git a/example/src/main.ts b/example/src/main.ts
index d9a2e7e..947bb03 100644
--- a/example/src/main.ts
+++ b/example/src/main.ts
@@ -1,8 +1,8 @@
-import { enableProdMode } from '@angular/core';
-import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+import {enableProdMode} from '@angular/core';
+import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
 
-import { AppModule } from './app/app.module';
-import { environment } from './environments/environment';
+import {AppModule} from './app/app.module';
+import {environment} from './environments/environment';
 
 if (environment.production) {
   enableProdMode();
@@ -10,4 +10,4 @@ if (environment.production) {
 
 platformBrowserDynamic()
   .bootstrapModule(AppModule)
-  .catch((err) => console.error(err));
+  .catch(err => console.error(err));
diff --git a/example/src/test.ts b/example/src/test.ts
index cbf2f64..13c4986 100644
--- a/example/src/test.ts
+++ b/example/src/test.ts
@@ -2,7 +2,7 @@
 
 import 'zone.js/testing';
 
-import { getTestBed } from '@angular/core/testing';
+import {getTestBed} from '@angular/core/testing';
 import {
   BrowserDynamicTestingModule,
   platformBrowserDynamicTesting,
@@ -20,9 +20,13 @@ declare const require: {
 };
 
 // First, initialize the Angular testing environment.
-getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
-  teardown: { destroyAfterEach: false },
-});
+getTestBed().initTestEnvironment(
+  BrowserDynamicTestingModule,
+  platformBrowserDynamicTesting(),
+  {
+    teardown: {destroyAfterEach: false},
+  }
+);
 // Then we find all the tests.
 const context = require.context('./', true, /\.spec\.ts$/);
 // And load the modules.
-- 
GitLab