build(aio): remove unused imports and local variables (#19682)
PR Close #19682
This commit is contained in:
parent
09b4244baf
commit
717c68089d
|
@ -1,10 +1,7 @@
|
||||||
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
|
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
|
||||||
import { Injector } from '@angular/core';
|
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
import { Subscription } from 'rxjs/Subscription';
|
||||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
|
||||||
|
|
||||||
import { LocationService } from 'app/shared/location.service';
|
import { LocationService } from 'app/shared/location.service';
|
||||||
import { MockLocationService } from 'testing/location.service';
|
import { MockLocationService } from 'testing/location.service';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||||
|
|
||||||
import { ApiListComponent } from './api-list.component';
|
import { ApiListComponent } from './api-list.component';
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { ReplaySubject } from 'rxjs/ReplaySubject';
|
||||||
import { combineLatest } from 'rxjs/observable/combineLatest';
|
import { combineLatest } from 'rxjs/observable/combineLatest';
|
||||||
|
|
||||||
import { LocationService } from 'app/shared/location.service';
|
import { LocationService } from 'app/shared/location.service';
|
||||||
import { ApiItem, ApiSection, ApiService } from './api.service';
|
import { ApiSection, ApiService } from './api.service';
|
||||||
|
|
||||||
import { Option } from 'app/shared/select/select.component';
|
import { Option } from 'app/shared/select/select.component';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
|
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
|
||||||
import { Injector } from '@angular/core';
|
import { Injector } from '@angular/core';
|
||||||
import { TestBed, inject } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { Logger } from 'app/shared/logger.service';
|
import { Logger } from 'app/shared/logger.service';
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
import { Component, ElementRef, ViewChild, OnChanges, OnDestroy, Input } from '@angular/core';
|
import { Component, ElementRef, ViewChild, OnChanges, Input } from '@angular/core';
|
||||||
import { Logger } from 'app/shared/logger.service';
|
import { Logger } from 'app/shared/logger.service';
|
||||||
import { PrettyPrinter } from './pretty-printer.service';
|
import { PrettyPrinter } from './pretty-printer.service';
|
||||||
import { CopierService } from 'app/shared/copier.service';
|
import { CopierService } from 'app/shared/copier.service';
|
||||||
import { MdSnackBar } from '@angular/material';
|
import { MdSnackBar } from '@angular/material';
|
||||||
|
|
||||||
const originalLabel = 'Copy Code';
|
|
||||||
const copiedLabel = 'Copied!';
|
|
||||||
const defaultLineNumsCount = 10; // by default, show linenums over this number
|
const defaultLineNumsCount = 10; // by default, show linenums over this number
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { Injector } from '@angular/core';
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { ContributorService } from './contributor.service';
|
import { ContributorService } from './contributor.service';
|
||||||
import { Contributor, ContributorGroup } from './contributors.model';
|
import { ContributorGroup } from './contributors.model';
|
||||||
|
|
||||||
describe('ContributorService', () => {
|
describe('ContributorService', () => {
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { LocationService } from 'app/shared/location.service';
|
import { LocationService } from 'app/shared/location.service';
|
||||||
import { MockLocationService } from 'testing/location.service';
|
import { MockLocationService } from 'testing/location.service';
|
||||||
import { CurrentLocationComponent } from './current-location.component';
|
import { CurrentLocationComponent } from './current-location.component';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { Component, DebugElement, ElementRef } from '@angular/core';
|
import { Component, DebugElement } from '@angular/core';
|
||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
|
|
||||||
import { LiveExampleComponent, EmbeddedPlunkerComponent } from './live-example.component';
|
import { LiveExampleComponent, EmbeddedPlunkerComponent } from './live-example.component';
|
||||||
|
@ -71,7 +71,6 @@ describe('LiveExampleComponent', () => {
|
||||||
|
|
||||||
describe('when not embedded', () => {
|
describe('when not embedded', () => {
|
||||||
function getLiveExampleAnchor() { return getAnchors()[0]; }
|
function getLiveExampleAnchor() { return getAnchors()[0]; }
|
||||||
function getDownloadAnchor() { return getAnchors()[1]; }
|
|
||||||
|
|
||||||
it('should create LiveExampleComponent', () => {
|
it('should create LiveExampleComponent', () => {
|
||||||
testComponent(() => {
|
testComponent(() => {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { ReflectiveInjector } from '@angular/core';
|
import { ReflectiveInjector } from '@angular/core';
|
||||||
import { PlatformLocation } from '@angular/common';
|
import { PlatformLocation } from '@angular/common';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
import { of } from 'rxjs/observable/of';
|
import { of } from 'rxjs/observable/of';
|
||||||
|
|
||||||
import { ResourceListComponent } from './resource-list.component';
|
import { ResourceListComponent } from './resource-list.component';
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { Injector } from '@angular/core';
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { ResourceService } from './resource.service';
|
import { ResourceService } from './resource.service';
|
||||||
import { Category, SubCategory, Resource } from './resource.model';
|
import { Category } from './resource.model';
|
||||||
|
|
||||||
describe('ResourceService', () => {
|
describe('ResourceService', () => {
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Component, CUSTOM_ELEMENTS_SCHEMA, DebugElement } from '@angular/core';
|
import { Component, CUSTOM_ELEMENTS_SCHEMA, DebugElement } from '@angular/core';
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { By, DOCUMENT } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||||
import { asap } from 'rxjs/scheduler/asap';
|
import { asap } from 'rxjs/scheduler/asap';
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import {
|
import { Component, DebugElement, ElementRef, NgModule, OnInit, ViewChild } from '@angular/core';
|
||||||
Component, ComponentFactoryResolver, DebugElement,
|
|
||||||
ElementRef, Injector, NgModule, OnInit, ViewChild } from '@angular/core';
|
|
||||||
import { By } from '@angular/platform-browser';
|
|
||||||
import { DocViewerComponent } from './doc-viewer.component';
|
import { DocViewerComponent } from './doc-viewer.component';
|
||||||
import { DocumentContents } from 'app/documents/document.service';
|
import { DocumentContents } from 'app/documents/document.service';
|
||||||
import { EmbeddedModule, embeddedComponents, EmbeddedComponents } from 'app/embedded/embedded.module';
|
import { EmbeddedModule, EmbeddedComponents } from 'app/embedded/embedded.module';
|
||||||
import { Title } from '@angular/platform-browser';
|
import { Title } from '@angular/platform-browser';
|
||||||
import { TocService } from 'app/shared/toc.service';
|
import { TocService } from 'app/shared/toc.service';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {
|
import {
|
||||||
Component, ComponentFactory, ComponentFactoryResolver, ComponentRef,
|
Component, ComponentFactory, ComponentFactoryResolver, ComponentRef,
|
||||||
DoCheck, ElementRef, EventEmitter, Injector, Input, OnDestroy,
|
DoCheck, ElementRef, EventEmitter, Injector, Input, OnDestroy,
|
||||||
Output, ViewEncapsulation
|
Output
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { EmbeddedComponents } from 'app/embedded/embedded.module';
|
import { EmbeddedComponents } from 'app/embedded/embedded.module';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { SimpleChange, SimpleChanges, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
|
|
||||||
import { NavItemComponent } from './nav-item.component';
|
import { NavItemComponent } from './nav-item.component';
|
||||||
import { NavigationNode } from 'app/navigation/navigation.model';
|
import { NavigationNode } from 'app/navigation/navigation.model';
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||||
|
|
||||||
import { TopMenuComponent } from './top-menu.component';
|
import { TopMenuComponent } from './top-menu.component';
|
||||||
import { NavigationService, NavigationViews, NavigationNode } from 'app/navigation/navigation.service';
|
import { NavigationService, NavigationViews } from 'app/navigation/navigation.service';
|
||||||
|
|
||||||
describe('TopMenuComponent', () => {
|
describe('TopMenuComponent', () => {
|
||||||
let component: TopMenuComponent;
|
let component: TopMenuComponent;
|
||||||
|
|
|
@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { AsyncSubject } from 'rxjs/AsyncSubject';
|
|
||||||
import { combineLatest } from 'rxjs/observable/combineLatest';
|
import { combineLatest } from 'rxjs/observable/combineLatest';
|
||||||
import 'rxjs/add/operator/map';
|
import 'rxjs/add/operator/map';
|
||||||
import 'rxjs/add/operator/publishLast';
|
import 'rxjs/add/operator/publishLast';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { MdIconRegistry } from '@angular/material';
|
import { MdIconRegistry } from '@angular/material';
|
||||||
import { CustomMdIconRegistry, SVG_ICONS, SvgIconInfo } from './custom-md-icon-registry';
|
import { CustomMdIconRegistry, SvgIconInfo } from './custom-md-icon-registry';
|
||||||
|
|
||||||
describe('CustomMdIconRegistry', () => {
|
describe('CustomMdIconRegistry', () => {
|
||||||
it('should get the SVG element for a preloaded icon from the cache', () => {
|
it('should get the SVG element for a preloaded icon from the cache', () => {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Location, PlatformLocation } from '@angular/common';
|
import { Location, PlatformLocation } from '@angular/common';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
import { ReplaySubject } from 'rxjs/ReplaySubject';
|
import { ReplaySubject } from 'rxjs/ReplaySubject';
|
||||||
import 'rxjs/add/operator/do';
|
import 'rxjs/add/operator/do';
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { fakeAsync, tick } from '@angular/core/testing';
|
||||||
import { DOCUMENT } from '@angular/platform-browser';
|
import { DOCUMENT } from '@angular/platform-browser';
|
||||||
|
|
||||||
import { ScrollService } from 'app/shared/scroll.service';
|
import { ScrollService } from 'app/shared/scroll.service';
|
||||||
import { ScrollItem, ScrollSpiedElement, ScrollSpiedElementGroup, ScrollSpyInfo, ScrollSpyService } from 'app/shared/scroll-spy.service';
|
import { ScrollItem, ScrollSpiedElement, ScrollSpiedElementGroup, ScrollSpyService } from 'app/shared/scroll-spy.service';
|
||||||
|
|
||||||
|
|
||||||
describe('ScrollSpiedElement', () => {
|
describe('ScrollSpiedElement', () => {
|
||||||
|
@ -197,6 +197,7 @@ describe('ScrollSpyService', () => {
|
||||||
.and.callFake(() => actions.push('calibrate'));
|
.and.callFake(() => actions.push('calibrate'));
|
||||||
|
|
||||||
expect(onResizeSpy).not.toHaveBeenCalled();
|
expect(onResizeSpy).not.toHaveBeenCalled();
|
||||||
|
expect(calibrateSpy).not.toHaveBeenCalled();
|
||||||
|
|
||||||
scrollSpyService.spyOn([]);
|
scrollSpyService.spyOn([]);
|
||||||
expect(actions).toEqual(['onResize', 'calibrate']);
|
expect(actions).toEqual(['onResize', 'calibrate']);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, DebugElement } from '@angular/core';
|
import { Component, DebugElement } from '@angular/core';
|
||||||
import { async, ComponentFixture, TestBed, inject } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { SelectComponent, Option } from './select.component';
|
import { SelectComponent, Option } from './select.component';
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { ReflectiveInjector, SecurityContext } from '@angular/core';
|
import { ReflectiveInjector } from '@angular/core';
|
||||||
import { DOCUMENT, DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
import { DOCUMENT, DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
||||||
import { Subject } from 'rxjs/Subject';
|
import { Subject } from 'rxjs/Subject';
|
||||||
|
|
||||||
|
@ -268,7 +268,6 @@ describe('TocService', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should calculate and set id of heading without an id', () => {
|
it('should calculate and set id of heading without an id', () => {
|
||||||
const tocItem = lastTocList.find(item => item.title === 'H2 Two');
|
|
||||||
const id = headings[2].getAttribute('id');
|
const id = headings[2].getAttribute('id');
|
||||||
expect(id).toEqual('h2-two');
|
expect(id).toEqual('h2-two');
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,7 +4,7 @@ Use of this source code is governed by an MIT-style license that
|
||||||
can be found in the LICENSE file at http://angular.io/license
|
can be found in the LICENSE file at http://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {NgZone, Injectable} from '@angular/core';
|
import {NgZone} from '@angular/core';
|
||||||
import {Observable} from 'rxjs/Observable';
|
import {Observable} from 'rxjs/Observable';
|
||||||
|
|
||||||
export interface WebWorkerMessage {
|
export interface WebWorkerMessage {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Inject, Injectable, OnDestroy } from '@angular/core';
|
import { Injectable, OnDestroy } from '@angular/core';
|
||||||
import { NgServiceWorker } from '@angular/service-worker';
|
import { NgServiceWorker } from '@angular/service-worker';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { Subject } from 'rxjs/Subject';
|
import { Subject } from 'rxjs/Subject';
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"node_modules/@types"
|
"node_modules/@types"
|
||||||
|
|
Loading…
Reference in New Issue