MOBILE-2323 core: Add tslint rule no-unused-variable and fix warnings

main
Albert Gasset 2018-03-14 10:32:05 +01:00
parent 92085c4889
commit 5faa1cf5e6
26 changed files with 25 additions and 51 deletions

View File

@ -14,7 +14,6 @@
import { Component, ViewChild, Input } from '@angular/core';
import { Content, NavController } from 'ionic-angular';
import { TranslateService } from '@ngx-translate/core';
import { CoreAppProvider } from '@providers/app';
import { CoreDomUtilsProvider } from '@providers/utils/dom';
import { AddonCompetencyProvider } from '../../providers/competency';
@ -37,8 +36,7 @@ export class AddonCompetencyCourseComponent {
competencies: any;
user: any;
constructor(private navCtrl: NavController, private translate: TranslateService,
private appProvider: CoreAppProvider, private domUtils: CoreDomUtilsProvider,
constructor(private navCtrl: NavController, private appProvider: CoreAppProvider, private domUtils: CoreDomUtilsProvider,
private competencyProvider: AddonCompetencyProvider, private helperProvider: AddonCompetencyHelperProvider) {
}

View File

@ -14,7 +14,6 @@
import { Component, Optional } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { TranslateService } from '@ngx-translate/core';
import { CoreDomUtilsProvider } from '@providers/utils/dom';
import { CoreSplitViewComponent } from '@components/split-view/split-view';
import { AddonCompetencyProvider } from '../../providers/competency';
@ -32,9 +31,8 @@ export class AddonCompetencyCompetencySummaryPage {
competencyId: number;
competency: any;
constructor(private navCtrl: NavController, navParams: NavParams, private translate: TranslateService,
private domUtils: CoreDomUtilsProvider, @Optional() private svComponent: CoreSplitViewComponent,
private competencyProvider: AddonCompetencyProvider) {
constructor(private navCtrl: NavController, navParams: NavParams, private domUtils: CoreDomUtilsProvider,
@Optional() private svComponent: CoreSplitViewComponent, private competencyProvider: AddonCompetencyProvider) {
this.competencyId = navParams.get('competencyId');
}

View File

@ -14,7 +14,6 @@
import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavParams } from 'ionic-angular';
import { TranslateService } from '@ngx-translate/core';
import { CoreDomUtilsProvider } from '@providers/utils/dom';
import { CoreSplitViewComponent } from '@components/split-view/split-view';
import { AddonCompetencyProvider } from '../../providers/competency';
@ -35,8 +34,7 @@ export class AddonCompetencyPlanListPage {
plansLoaded = false;
plans = [];
constructor(navParams: NavParams, private translate: TranslateService, private domUtils: CoreDomUtilsProvider,
private competencyProvider: AddonCompetencyProvider) {
constructor(navParams: NavParams, private domUtils: CoreDomUtilsProvider, private competencyProvider: AddonCompetencyProvider) {
this.userId = navParams.get('userId');
}

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { Component, ViewChild, OnDestroy } from '@angular/core';
import { IonicPage, NavParams, NavController } from 'ionic-angular';
import { Component, OnDestroy } from '@angular/core';
import { IonicPage, NavParams } from 'ionic-angular';
import { TranslateService } from '@ngx-translate/core';
import { CoreAppProvider } from '@providers/app';
import { CoreEventsProvider } from '@providers/events';

View File

@ -16,7 +16,6 @@ import { Injectable } from '@angular/core';
import { CoreSitesProvider } from '@providers/sites';
import { CoreMimetypeUtilsProvider } from '@providers/utils/mimetype';
import { CoreSite } from '@classes/site';
import { Md5 } from 'ts-md5/dist/md5';
/**
* Service to handle my files and site files.

View File

@ -18,7 +18,6 @@ import { TranslateService } from '@ngx-translate/core';
import { CoreSitesProvider } from '@providers/sites';
import { AddonMessagesProvider } from '../../providers/messages';
import { CoreDomUtilsProvider } from '@providers/utils/dom';
import { CoreUtilsProvider } from '@providers/utils/utils';
import { CoreAppProvider } from '@providers/app';
import { CoreEventsProvider } from '@providers/events';

View File

@ -28,7 +28,6 @@ import { AddonMessagesBlockContactUserHandler } from './providers/user-block-con
import { AddonMessagesDiscussionLinkHandler } from './providers/discussion-link-handler';
import { AddonMessagesIndexLinkHandler } from './providers/index-link-handler';
import { AddonMessagesSyncCronHandler } from './providers/sync-cron-handler';
import { CoreEventsProvider } from '@providers/events';
import { CoreAppProvider } from '@providers/app';
import { CoreSitesProvider } from '@providers/sites';
import { CoreLocalNotificationsProvider } from '@providers/local-notifications';

View File

@ -33,8 +33,7 @@ export class AddonMessagesIndexPage implements OnDestroy {
protected loadSplitViewObserver: any;
protected siteId: string;
constructor(private eventsProvider: CoreEventsProvider, sitesProvider: CoreSitesProvider,
private messagesProvider: AddonMessagesProvider) {
constructor(eventsProvider: CoreEventsProvider, sitesProvider: CoreSitesProvider) {
this.siteId = sitesProvider.getCurrentSiteId();

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable, Inject } from '@angular/core';
import { Injectable } from '@angular/core';
import { AddonMessagesProvider } from './messages';
import { CoreMainMenuDelegate, CoreMainMenuHandler, CoreMainMenuHandlerToDisplay } from '@core/mainmenu/providers/delegate';
import { CoreCronHandler } from '@providers/cron';

View File

@ -12,10 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { Injectable, Inject } from '@angular/core';
import { Injectable } from '@angular/core';
import { AddonMessagesProvider } from './messages';
import { CoreSettingsHandler, CoreSettingsHandlerData } from '@core/settings/providers/delegate';
import { CoreSitesProvider } from '@providers/sites';
/**
* Message settings handler.
@ -25,7 +24,7 @@ export class AddonMessagesSettingsHandler implements CoreSettingsHandler {
name = 'AddonMessages';
priority = 600;
constructor(private messagesProvider: AddonMessagesProvider, private sitesProvider: CoreSitesProvider) {
constructor(private messagesProvider: AddonMessagesProvider) {
}
/**

View File

@ -14,7 +14,6 @@
import { Injectable } from '@angular/core';
import { CoreCronHandler } from '@providers/cron';
import { CoreSitesProvider } from '@providers/sites';
import { AddonMessagesSyncProvider } from './sync';
/**
@ -24,7 +23,7 @@ import { AddonMessagesSyncProvider } from './sync';
export class AddonMessagesSyncCronHandler implements CoreCronHandler {
name = 'AddonMessagesSyncCronHandler';
constructor(private sitesProvider: CoreSitesProvider, private messagesSync: AddonMessagesSyncProvider) {}
constructor(private messagesSync: AddonMessagesSyncProvider) {}
/**
* Execute the process.

View File

@ -15,7 +15,6 @@
import { Injectable, OnDestroy } from '@angular/core';
import { CoreUserDelegate, CoreUserProfileHandler, CoreUserProfileHandlerData } from '@core/user/providers/user-delegate';
import { CoreSitesProvider } from '@providers/sites';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { AddonMessagesProvider } from './messages';
import { AddonMessagesBlockContactUserHandler } from './user-block-contact-handler';
import { CoreEventsProvider } from '@providers/events';
@ -40,7 +39,7 @@ export class AddonMessagesAddContactUserHandler implements CoreUserProfileHandle
protected disabled = false;
protected updateObs: any;
constructor(private linkHelper: CoreContentLinksHelperProvider, protected sitesProvider: CoreSitesProvider,
constructor(protected sitesProvider: CoreSitesProvider,
private messagesProvider: AddonMessagesProvider, protected eventsProvider: CoreEventsProvider,
private domUtils: CoreDomUtilsProvider, private translate: TranslateService) {

View File

@ -15,7 +15,6 @@
import { Injectable, OnDestroy } from '@angular/core';
import { CoreUserDelegate, CoreUserProfileHandler, CoreUserProfileHandlerData } from '@core/user/providers/user-delegate';
import { CoreSitesProvider } from '@providers/sites';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { AddonMessagesProvider } from './messages';
import { AddonMessagesAddContactUserHandler } from './user-add-contact-handler';
import { CoreEventsProvider } from '@providers/events';
@ -40,9 +39,9 @@ export class AddonMessagesBlockContactUserHandler implements CoreUserProfileHand
protected disabled = false;
protected updateObs: any;
constructor(private linkHelper: CoreContentLinksHelperProvider, protected sitesProvider: CoreSitesProvider,
private messagesProvider: AddonMessagesProvider, protected eventsProvider: CoreEventsProvider,
private domUtils: CoreDomUtilsProvider, private translate: TranslateService) {
constructor(protected sitesProvider: CoreSitesProvider, private messagesProvider: AddonMessagesProvider,
protected eventsProvider: CoreEventsProvider, private domUtils: CoreDomUtilsProvider,
private translate: TranslateService) {
this.updateObs = eventsProvider.on(AddonMessagesAddContactUserHandler.UPDATED_EVENT, (data) => {
this.checkButton(data.userId);

View File

@ -39,7 +39,7 @@ export class CoreContextMenuComponent implements OnInit, OnDestroy {
protected instanceId: string;
protected parentContextMenu: CoreContextMenuComponent;
constructor(private translate: TranslateService, private popoverCtrl: PopoverController, private elementRef: ElementRef,
constructor(private translate: TranslateService, private popoverCtrl: PopoverController, elementRef: ElementRef,
private domUtils: CoreDomUtilsProvider) {
// Create the stream and subscribe to it. We ignore successive changes during 250ms.
this.itemsChangedStream = new Subject<void>();

View File

@ -15,7 +15,6 @@
import { Component, ViewChild, Input, Optional } from '@angular/core';
import { Content, NavParams, NavController } from 'ionic-angular';
import { CoreGradesProvider } from '../../providers/grades';
import { CoreSitesProvider } from '@providers/sites';
import { CoreDomUtilsProvider } from '@providers/utils/dom';
import { CoreGradesHelperProvider } from '../../providers/helper';
import { CoreSplitViewComponent } from '@components/split-view/split-view';
@ -39,9 +38,8 @@ export class CoreGradesCourseComponent {
gradesTable: any;
constructor(private gradesProvider: CoreGradesProvider, private domUtils: CoreDomUtilsProvider, navParams: NavParams,
private gradesHelper: CoreGradesHelperProvider, private sitesProvider: CoreSitesProvider,
@Optional() private navCtrl: NavController, private appProvider: CoreAppProvider,
@Optional() private svComponent: CoreSplitViewComponent) {
private gradesHelper: CoreGradesHelperProvider, @Optional() private navCtrl: NavController,
private appProvider: CoreAppProvider, @Optional() private svComponent: CoreSplitViewComponent) {
}
/**

View File

@ -13,7 +13,6 @@
// limitations under the License.
import { Injectable, Injector } from '@angular/core';
import { NavController } from 'ionic-angular';
import { CoreCourseOptionsHandler, CoreCourseOptionsHandlerData } from '@core/course/providers/options-delegate';
import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreGradesProvider } from './grades';

View File

@ -14,7 +14,6 @@
import { Injectable } from '@angular/core';
import { CoreLoggerProvider } from '@providers/logger';
import { CoreSite } from '@classes/site';
import { CoreSitesProvider } from '@providers/sites';
import { CoreCoursesProvider } from '@core/courses/providers/courses';

View File

@ -15,7 +15,6 @@
import { Injectable } from '@angular/core';
import { CoreLoggerProvider } from '@providers/logger';
import { CoreSitesProvider } from '@providers/sites';
import { TranslateService } from '@ngx-translate/core';
import { CoreCoursesProvider } from '@core/courses/providers/courses';
import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreGradesProvider } from './grades';
@ -33,8 +32,7 @@ export class CoreGradesHelperProvider {
constructor(logger: CoreLoggerProvider, private coursesProvider: CoreCoursesProvider,
private gradesProvider: CoreGradesProvider, private sitesProvider: CoreSitesProvider,
private textUtils: CoreTextUtilsProvider, private courseProvider: CoreCourseProvider,
private domUtils: CoreDomUtilsProvider, private translate: TranslateService,
private urlUtils: CoreUrlUtilsProvider) {
private domUtils: CoreDomUtilsProvider, private urlUtils: CoreUrlUtilsProvider) {
this.logger = logger.getInstance('CoreGradesHelperProvider');
}

View File

@ -13,7 +13,7 @@
// limitations under the License.
import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams, Platform } from 'ionic-angular';
import { IonicPage, NavParams, Platform } from 'ionic-angular';
import { CoreSettingsDelegate, CoreSettingsHandlerData } from '../../providers/delegate';
import { CoreSplitViewComponent } from '@components/split-view/split-view';
@ -32,8 +32,7 @@ export class CoreSettingsListPage {
isIOS: boolean;
selectedPage: string;
constructor(private settingsDelegate: CoreSettingsDelegate, private navCtrl: NavController, platorm: Platform,
navParams: NavParams) {
constructor(private settingsDelegate: CoreSettingsDelegate, platorm: Platform, navParams: NavParams) {
this.isIOS = platorm.is('ios');
this.selectedPage = navParams.get('page') || false;

View File

@ -12,10 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { Directive, Input, OnInit, ElementRef, Optional } from '@angular/core';
import { Directive, OnInit, ElementRef, Optional } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { CoreDomUtilsProvider } from '@providers/utils/dom';
import { CoreUtilsProvider } from '@providers/utils/utils';
import { CoreSitePluginsProvider } from '../providers/siteplugins';
import { CoreSitePluginsCallWSBaseDirective } from '../classes/call-ws-directive';
import { CoreSitePluginsPluginContentComponent } from '../components/plugin-content/plugin-content';

View File

@ -20,7 +20,6 @@ import { CoreLangProvider } from '@providers/lang';
import { CoreLoggerProvider } from '@providers/logger';
import { CoreSite, CoreSiteWSPreSets } from '@classes/site';
import { CoreSitesProvider } from '@providers/sites';
import { CoreTextUtilsProvider } from '@providers/utils/text';
import { CoreUtilsProvider } from '@providers/utils/utils';
import { CoreConfigConstants } from '../../../configconstants';
import { CoreCoursesProvider } from '@core/courses/providers/courses';
@ -67,8 +66,7 @@ export class CoreSitePluginsProvider {
constructor(logger: CoreLoggerProvider, private sitesProvider: CoreSitesProvider, private utils: CoreUtilsProvider,
private langProvider: CoreLangProvider, private appProvider: CoreAppProvider, private platform: Platform,
private filepoolProvider: CoreFilepoolProvider, private coursesProvider: CoreCoursesProvider,
private textUtils: CoreTextUtilsProvider) {
private filepoolProvider: CoreFilepoolProvider, private coursesProvider: CoreCoursesProvider) {
this.logger = logger.getInstance('CoreUserProvider');
}

View File

@ -13,7 +13,7 @@
// limitations under the License.
import { Component, ViewChild, Input, OnInit } from '@angular/core';
import { Content, NavParams } from 'ionic-angular';
import { Content } from 'ionic-angular';
import { CoreUserProvider } from '../../providers/user';
import { CoreDomUtilsProvider } from '@providers/utils/dom';
import { CoreSplitViewComponent } from '@components/split-view/split-view';

View File

@ -13,7 +13,6 @@
// limitations under the License.
import { Injectable, Injector } from '@angular/core';
import { NavController } from 'ionic-angular';
import { CoreCourseOptionsHandler, CoreCourseOptionsHandlerData } from '@core/course/providers/options-delegate';
import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreUserProvider } from './user';

View File

@ -15,7 +15,6 @@
import { Directive, Input, OnInit, ElementRef } from '@angular/core';
import { CoreFileHelperProvider } from '@providers/file-helper';
import { CoreDomUtilsProvider } from '@providers/utils/dom';
import { CoreUtilsProvider } from '@providers/utils/utils';
/**
* Directive to allow downloading and open a file. When the item with this directive is clicked, the file will be

View File

@ -19,7 +19,6 @@ import { Globalization } from '@ionic-native/globalization';
import { Platform } from 'ionic-angular';
import { CoreConfigProvider } from './config';
import { CoreConfigConstants } from '../configconstants';
import { Observable } from 'rxjs';
/*
* Service to handle language features, like changing the current language.

View File

@ -55,6 +55,7 @@
"no-eval": true,
"no-invalid-this": true,
"no-this-assignment": true,
"no-unused-variable": true,
"no-var-keyword": true,
"switch-default": true,
"typeof-compare": true,