MOBILE-2340 core: Fix linter errors
parent
6cdb32d30d
commit
66ee81609c
|
@ -14,7 +14,7 @@
|
|||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AddonMessagesProvider } from './messages';
|
||||
import { CoreMainMenuDelegate, CoreMainMenuHandler, CoreMainMenuHandlerToDisplay } from '@core/mainmenu/providers/delegate';
|
||||
import { CoreMainMenuHandler, CoreMainMenuHandlerToDisplay } from '@core/mainmenu/providers/delegate';
|
||||
import { CoreCronHandler } from '@providers/cron';
|
||||
import { CoreSitesProvider } from '@providers/sites';
|
||||
import { CoreEventsProvider } from '@providers/events';
|
||||
|
|
|
@ -17,15 +17,12 @@ import { CoreDomUtilsProvider } from '@providers/utils/dom';
|
|||
import { CoreCourseProvider } from '@core/course/providers/course';
|
||||
import { CoreCourseHelperProvider } from '@core/course/providers/helper';
|
||||
import { AddonModResourceProvider } from './resource';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { CoreSitesProvider } from '@providers/sites';
|
||||
import { CoreUtilsProvider } from '@providers/utils/utils';
|
||||
import { CoreFilepoolProvider } from '@providers/filepool';
|
||||
import { CoreFileProvider } from '@providers/file';
|
||||
import { CoreAppProvider } from '@providers/app';
|
||||
import { CoreMimetypeUtilsProvider } from '@providers/utils/mimetype';
|
||||
import { CoreTextUtilsProvider } from '@providers/utils/text';
|
||||
import { CoreConstants } from '@core/constants';
|
||||
|
||||
/**
|
||||
* Service that provides helper functions for resources.
|
||||
|
@ -43,8 +40,7 @@ export class AddonModResourceHelperProvider {
|
|||
private resourceProvider: AddonModResourceProvider, private courseHelper: CoreCourseHelperProvider,
|
||||
private textUtils: CoreTextUtilsProvider, private mimetypeUtils: CoreMimetypeUtilsProvider,
|
||||
private fileProvider: CoreFileProvider, private appProvider: CoreAppProvider,
|
||||
private filepoolProvider: CoreFilepoolProvider, private utils: CoreUtilsProvider,
|
||||
private sitesProvider: CoreSitesProvider, private translate: TranslateService) {
|
||||
private filepoolProvider: CoreFilepoolProvider, private sitesProvider: CoreSitesProvider) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -25,9 +25,9 @@ import { CoreUtilsProvider } from '@providers/utils/utils';
|
|||
})
|
||||
export class AddonUserProfileFieldCheckboxComponent implements OnInit {
|
||||
@Input() field: any; // The profile field to be rendered.
|
||||
@Input() edit?: false; // True if editing the field. Defaults to false.
|
||||
@Input() disabled?: false; // True if disabled. Defaults to false.
|
||||
@Input() form?: FormGroup; // Form where to add the form control.
|
||||
@Input() edit = false; // True if editing the field. Defaults to false.
|
||||
@Input() disabled = false; // True if disabled. Defaults to false.
|
||||
@Input() form: FormGroup; // Form where to add the form control.
|
||||
|
||||
constructor(private fb: FormBuilder, protected utils: CoreUtilsProvider) { }
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@ import { CoreUtilsProvider } from '@providers/utils/utils';
|
|||
})
|
||||
export class AddonUserProfileFieldDatetimeComponent implements OnInit {
|
||||
@Input() field: any; // The profile field to be rendered.
|
||||
@Input() edit? = false; // True if editing the field. Defaults to false.
|
||||
@Input() disabled? = false; // True if disabled. Defaults to false.
|
||||
@Input() edit = false; // True if editing the field. Defaults to false.
|
||||
@Input() disabled = false; // True if disabled. Defaults to false.
|
||||
@Input() form?: FormGroup; // Form where to add the form control.
|
||||
|
||||
constructor(private fb: FormBuilder, private timeUtils: CoreTimeUtilsProvider, protected utils: CoreUtilsProvider) { }
|
||||
|
|
|
@ -24,8 +24,8 @@ import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
|||
})
|
||||
export class AddonUserProfileFieldMenuComponent implements OnInit {
|
||||
@Input() field: any; // The profile field to be rendered.
|
||||
@Input() edit? = false; // True if editing the field. Defaults to false.
|
||||
@Input() disabled? = false; // True if disabled. Defaults to false.
|
||||
@Input() edit = false; // True if editing the field. Defaults to false.
|
||||
@Input() disabled = false; // True if disabled. Defaults to false.
|
||||
@Input() form?: FormGroup; // Form where to add the form control.
|
||||
|
||||
constructor(private fb: FormBuilder) { }
|
||||
|
|
|
@ -25,8 +25,8 @@ import { CoreUtilsProvider } from '@providers/utils/utils';
|
|||
})
|
||||
export class AddonUserProfileFieldTextComponent implements OnInit {
|
||||
@Input() field: any; // The profile field to be rendered.
|
||||
@Input() edit? = false; // True if editing the field. Defaults to false.
|
||||
@Input() disabled? = false; // True if disabled. Defaults to false.
|
||||
@Input() edit = false; // True if editing the field. Defaults to false.
|
||||
@Input() disabled = false; // True if disabled. Defaults to false.
|
||||
@Input() form?: FormGroup; // Form where to add the form control.
|
||||
|
||||
constructor(private fb: FormBuilder, protected utils: CoreUtilsProvider) { }
|
||||
|
|
|
@ -24,8 +24,8 @@ import { FormGroup, Validators, FormControl } from '@angular/forms';
|
|||
})
|
||||
export class AddonUserProfileFieldTextareaComponent implements OnInit {
|
||||
@Input() field: any; // The profile field to be rendered.
|
||||
@Input() edit? = false; // True if editing the field. Defaults to false.
|
||||
@Input() disabled? = false; // True if disabled. Defaults to false.
|
||||
@Input() edit = false; // True if editing the field. Defaults to false.
|
||||
@Input() disabled = false; // True if disabled. Defaults to false.
|
||||
@Input() form?: FormGroup; // Form where to add the form control.
|
||||
|
||||
control: FormControl;
|
||||
|
|
|
@ -32,7 +32,7 @@ import { Component, Input, OnChanges, OnDestroy, Output, EventEmitter, SimpleCha
|
|||
})
|
||||
export class CoreChronoComponent implements OnChanges, OnDestroy {
|
||||
@Input() running: boolean; // Set it to true to start the chrono. Set it to false to stop it.
|
||||
@Input() startTime? = 0; // Number of milliseconds to put in the chrono before starting.
|
||||
@Input() startTime = 0; // Number of milliseconds to put in the chrono before starting.
|
||||
@Input() endTime?: number; // Number of milliseconds to stop the chrono.
|
||||
@Input() reset?: boolean; // Set it to true to reset the chrono.
|
||||
@Output() onEnd?: EventEmitter<void>; // Will emit an event when the endTime is reached.
|
||||
|
|
|
@ -40,7 +40,7 @@ export class CoreRichTextEditorComponent {
|
|||
// Based on: https://github.com/judgewest2000/Ionic3RichText/
|
||||
// @todo: Resize, images, anchor button, fullscreen...
|
||||
|
||||
@Input() placeholder? = ''; // Placeholder to set in textarea.
|
||||
@Input() placeholder = ''; // Placeholder to set in textarea.
|
||||
@Input() control: FormControl; // Form control.
|
||||
@Output() contentChanged: EventEmitter<string>;
|
||||
|
||||
|
|
|
@ -33,12 +33,12 @@ import { CoreUtilsProvider } from '@providers/utils/utils';
|
|||
export class CoreSearchBoxComponent implements OnInit {
|
||||
@Input() searchLabel?: string; // Label to be used on action button.
|
||||
@Input() placeholder?: string; // Placeholder text for search text input.
|
||||
@Input() autocorrect? = 'on'; // Enables/disable Autocorrection on search text input.
|
||||
@Input() autocorrect = 'on'; // Enables/disable Autocorrection on search text input.
|
||||
@Input() spellcheck?: string | boolean = true; // Enables/disable Spellchecker on search text input.
|
||||
@Input() autoFocus?: string | boolean; // Enables/disable Autofocus when entering view.
|
||||
@Input() lengthCheck? = 3; // Check value length before submit. If 0, any string will be submitted.
|
||||
@Input() showClear? = true; // Show/hide clear button.
|
||||
@Input() disabled? = false; // Disables the input text.
|
||||
@Input() lengthCheck = 3; // Check value length before submit. If 0, any string will be submitted.
|
||||
@Input() showClear = true; // Show/hide clear button.
|
||||
@Input() disabled = false; // Disables the input text.
|
||||
@Output() onSubmit: EventEmitter<string>; // Send data when submitting the search form.
|
||||
@Output() onClear?: EventEmitter<void>; // Send event when clearing the search form.
|
||||
|
||||
|
|
|
@ -46,8 +46,8 @@ export class CoreTabComponent implements OnInit, OnDestroy {
|
|||
@Input() icon?: string; // The tab icon.
|
||||
@Input() badge?: string; // A badge to add in the tab.
|
||||
@Input() badgeStyle?: string; // The badge color.
|
||||
@Input() enabled? = true; // Whether the tab is enabled.
|
||||
@Input() show? = true; // Whether the tab should be shown.
|
||||
@Input() enabled = true; // Whether the tab is enabled.
|
||||
@Input() show = true; // Whether the tab should be shown.
|
||||
@Input() id?: string; // An ID to identify the tab.
|
||||
@Output() ionSelect: EventEmitter<CoreTabComponent> = new EventEmitter<CoreTabComponent>();
|
||||
|
||||
|
|
|
@ -242,15 +242,11 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges {
|
|||
protected sortTabs(): void {
|
||||
if (this.originalTabsContainer) {
|
||||
const newTabs = [];
|
||||
let newSelected;
|
||||
|
||||
this.tabs.forEach((tab, index) => {
|
||||
const originalIndex = Array.prototype.indexOf.call(this.originalTabsContainer.children, tab.element);
|
||||
if (originalIndex != -1) {
|
||||
newTabs[originalIndex] = tab;
|
||||
if (this.selected == index) {
|
||||
newSelected = originalIndex;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -238,7 +238,6 @@ export class FileTransferObjectMock extends FileTransferObject {
|
|||
const basicAuthHeader = this.getBasicAuthHeader(url);
|
||||
let fileKey = null,
|
||||
fileName = null,
|
||||
mimeType = null,
|
||||
params = null,
|
||||
headers = null,
|
||||
httpMethod = null;
|
||||
|
@ -254,7 +253,6 @@ export class FileTransferObjectMock extends FileTransferObject {
|
|||
if (options) {
|
||||
fileKey = options.fileKey;
|
||||
fileName = options.fileName;
|
||||
mimeType = options.mimeType;
|
||||
headers = options.headers;
|
||||
httpMethod = options.httpMethod || 'POST';
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
import { Component, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams, Tabs } from 'ionic-angular';
|
||||
import { CoreEventsProvider } from '@providers/events';
|
||||
import { CoreSitesProvider } from '@providers/sites';
|
||||
import { CoreMainMenuProvider } from '../../providers/mainmenu';
|
||||
import { CoreMainMenuDelegate, CoreMainMenuHandlerData } from '../../providers/delegate';
|
||||
|
@ -66,7 +65,7 @@ export class CoreMainMenuPage implements OnDestroy {
|
|||
protected redirectPageLoaded = false;
|
||||
|
||||
constructor(private menuDelegate: CoreMainMenuDelegate, private sitesProvider: CoreSitesProvider, navParams: NavParams,
|
||||
private navCtrl: NavController, private eventsProvider: CoreEventsProvider) {
|
||||
private navCtrl: NavController) {
|
||||
this.redirectPage = navParams.get('redirectPage');
|
||||
this.redirectParams = navParams.get('redirectParams');
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ export class CoreMainMenuMorePage implements OnDestroy {
|
|||
|
||||
constructor(private menuDelegate: CoreMainMenuDelegate, private sitesProvider: CoreSitesProvider,
|
||||
private navCtrl: NavController, private mainMenuProvider: CoreMainMenuProvider,
|
||||
private eventsProvider: CoreEventsProvider) {
|
||||
eventsProvider: CoreEventsProvider) {
|
||||
|
||||
this.langObserver = eventsProvider.on(CoreEventsProvider.LANGUAGE_CHANGED, this.loadSiteInfo.bind(this));
|
||||
this.updateSiteObserver = eventsProvider.on(CoreEventsProvider.SITE_UPDATED, this.loadSiteInfo.bind(this),
|
||||
|
|
|
@ -30,7 +30,7 @@ import { CoreConfigConstants } from '../configconstants';
|
|||
export class CoreLinkDirective implements OnInit {
|
||||
@Input() capture?: boolean | string; // If the link needs to be captured by the app.
|
||||
@Input() inApp?: boolean | string; // True to open in embedded browser, false to open in system browser.
|
||||
@Input() autoLogin?= 'check'; // If the link should be open with auto-login. Accepts the following values:
|
||||
@Input() autoLogin = 'check'; // If the link should be open with auto-login. Accepts the following values:
|
||||
// "yes" -> Always auto-login.
|
||||
// "no" -> Never auto-login.
|
||||
// "check" -> Auto-login only if it points to the current site. Default value.
|
||||
|
|
|
@ -21,7 +21,6 @@ import { CoreLoggerProvider } from './logger';
|
|||
import { CoreSitesFactoryProvider } from './sites-factory';
|
||||
import { CoreTextUtilsProvider } from './utils/text';
|
||||
import { CoreUrlUtilsProvider } from './utils/url';
|
||||
import { CoreUtilsProvider } from './utils/utils';
|
||||
import { CoreConstants } from '@core/constants';
|
||||
import { CoreConfigConstants } from '../configconstants';
|
||||
import { CoreSite } from '@classes/site';
|
||||
|
@ -211,9 +210,8 @@ export class CoreSitesProvider {
|
|||
protected siteTablesSchemas = []; // Schemas for site tables. Other providers can add schemas in here.
|
||||
|
||||
constructor(logger: CoreLoggerProvider, private http: HttpClient, private sitesFactory: CoreSitesFactoryProvider,
|
||||
private appProvider: CoreAppProvider, private utils: CoreUtilsProvider, private translate: TranslateService,
|
||||
private eventsProvider: CoreEventsProvider, private urlUtils: CoreUrlUtilsProvider,
|
||||
private textUtils: CoreTextUtilsProvider) {
|
||||
private appProvider: CoreAppProvider, private translate: TranslateService, private urlUtils: CoreUrlUtilsProvider,
|
||||
private eventsProvider: CoreEventsProvider, private textUtils: CoreTextUtilsProvider) {
|
||||
this.logger = logger.getInstance('CoreSitesProvider');
|
||||
|
||||
this.appDB = appProvider.getDB();
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Platform } from 'ionic-angular';
|
||||
import { Observable } from 'rxjs';
|
||||
import { InAppBrowser, InAppBrowserObject } from '@ionic-native/in-app-browser';
|
||||
import { Clipboard } from '@ionic-native/clipboard';
|
||||
import { CoreAppProvider } from '../app';
|
||||
|
@ -699,15 +698,6 @@ export class CoreUtilsProvider {
|
|||
options.location = 'no';
|
||||
}
|
||||
|
||||
// Convert the options to a string.
|
||||
const optionsArray = [];
|
||||
let optionsString;
|
||||
|
||||
for (const name in options) {
|
||||
optionsArray.push(`${name}=${options[name]}`);
|
||||
}
|
||||
optionsString = optionsArray.join(',');
|
||||
|
||||
this.iabInstance = this.iab.create(url, '_blank', options);
|
||||
|
||||
if (this.appProvider.isDesktop() || this.appProvider.isMobile()) {
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
"no-unused-variable": true,
|
||||
"no-var-keyword": true,
|
||||
"switch-default": true,
|
||||
"typeof-compare": true,
|
||||
"use-isnan": true,
|
||||
"eofline": true,
|
||||
"indent": [true, "spaces", 4],
|
||||
|
|
Loading…
Reference in New Issue