Skip to content
This repository has been archived by the owner on Mar 23, 2020. It is now read-only.

Commit

Permalink
Fixed lint check issues and removed deprecated rules from tslint.json
Browse files Browse the repository at this point in the history
  • Loading branch information
mshariq-nerd committed Sep 14, 2018
1 parent 5d5f76b commit 90e2317
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 48 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -54,7 +54,7 @@
"protractor": "~5.1.2",
"protractor-beautiful-reporter": "~1.2.1",
"ts-node": "~3.3.0",
"tslint": "~5.5.0",
"tslint": "^5.11.0",
"typescript": "~2.7.2"
}
}
5 changes: 3 additions & 2 deletions src/app/components/core/audit-log/audit-log.component.ts
@@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { AuditService, AlertService } from '../../../services/index';
import { NgProgress } from 'ngx-progressbar';

import { AlertService, AuditService } from '../../../services';
import { MAX_INT_SIZE } from '../../../utils';

@Component({
Expand Down Expand Up @@ -139,7 +140,7 @@ export class AuditLogComponent implements OnInit {
this.page = 1;
this.tempOffset = this.offset;
}
if (limit === '' || limit == 0 || limit === null || limit === undefined) {
if (limit === '' || limit === 0 || limit === null || limit === undefined) {
limit = this.DEFAULT_LIMIT;
}
this.limit = limit;
Expand Down
Expand Up @@ -57,10 +57,10 @@ export class UploadCertificateComponent implements OnInit {
}

onKeyChange(event) {
if (event.target.files.length != 0) {
if (event.target.files.length !== 0) {
const fileName = event.target.files[0].name;
const ext = fileName.substr(fileName.lastIndexOf('.') + 1);
if (ext == 'key') {
if (ext === 'key') {
this.keyExtension = true;
} else {
this.keyExtension = false;
Expand All @@ -74,10 +74,10 @@ export class UploadCertificateComponent implements OnInit {
}

onCertChange(event) {
if (event.target.files.length != 0) {
if (event.target.files.length !== 0) {
const fileName = event.target.files[0].name;
const ext = fileName.substr(fileName.lastIndexOf('.') + 1);
if (ext == 'cert') {
if (ext === 'cert') {
this.certExtension = true;
} else {
this.certExtension = false;
Expand Down
@@ -1,13 +1,11 @@
import { Component, OnInit, ViewChild, EventEmitter, Output } from '@angular/core';
import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core';
import { sortBy } from 'lodash';

import Utils from '../../../../utils';
import { NgProgress } from 'ngx-progressbar';

import { UpdateScheduleComponent } from '../update-schedule/update-schedule.component';
import { AlertService, ConfigurationService, SchedulesService } from '../../../../services';
import Utils from '../../../../utils';
import { AlertDialogComponent } from '../../../common/alert-dialog/alert-dialog.component';
import { SchedulesService, AlertService, ConfigurationService } from '../../../../services/index';

import { UpdateScheduleComponent } from '../update-schedule/update-schedule.component';

enum weekDays {
Mon = 1,
Expand Down Expand Up @@ -54,7 +52,7 @@ export class ListSchedulesComponent implements OnInit {
this.getScheduleType();
this.getSchedulesProcesses();

this.days = Object.keys(weekDays).map(key => weekDays[key]).filter(value => typeof value == 'string') as string[];
this.days = Object.keys(weekDays).map(key => weekDays[key]).filter(value => typeof value === 'string') as string[];
this.getSchedules();

this.updateScheduleData = {
Expand Down Expand Up @@ -109,7 +107,7 @@ export class ListSchedulesComponent implements OnInit {

this.scheduleData.forEach(element => {
const repeatTimeObj = Utils.secondsToDhms(element.repeat);
if (repeatTimeObj.days == 1) {
if (repeatTimeObj.days === 1) {
element.repeat = repeatTimeObj.days + ' day, ' + repeatTimeObj.time;
} else if (repeatTimeObj.days > 1) {
element.repeat = repeatTimeObj.days + ' days, ' + repeatTimeObj.time;
Expand Down
Expand Up @@ -58,8 +58,8 @@ export class UpdateScheduleComponent implements OnInit, OnChanges {
* @param value
*/
public setScheduleTypeKey(value) {
if (value != undefined) {
return this.scheduleType.find(object => object.name == value).index;
if (value !== undefined) {
return this.scheduleType.find(object => object.name === value).index;
}
}

Expand Down Expand Up @@ -88,15 +88,15 @@ export class UpdateScheduleComponent implements OnInit, OnChanges {
* @param id to get schedule
*/
public getSchedule(id): void {
if (id == undefined) {
if (id === undefined) {
return;
}

let scheduleDay;
this.schedulesService.getSchedule(id).
subscribe(
(data) => {
if (data['type'] == 'TIMED') {
if (data['type'] === 'TIMED') {
this.selectedScheduleType = this.setScheduleTypeKey(data['type']);
scheduleDay = this.getSelectedDay(data['day']);
} else {
Expand Down Expand Up @@ -144,7 +144,7 @@ export class UpdateScheduleComponent implements OnInit, OnChanges {
this.toggleModal(false);
return false;
}
const repeatTime = this.form.get('repeat').value != ('None' || undefined) ? Utils.convertTimeToSec(
const repeatTime = this.form.get('repeat').value !== ('None' || undefined) ? Utils.convertTimeToSec(
this.form.get('repeat').value, this.form.get('repeatDay').value) : 0;

this.selectedScheduleType = this.setScheduleTypeKey(this.form.get('type').value);
Expand Down
5 changes: 3 additions & 2 deletions src/app/components/core/system-log/system-log.component.ts
@@ -1,7 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { SystemLogService, AlertService } from '../../../services/index';
import { NgProgress } from 'ngx-progressbar';

import { AlertService, SystemLogService } from '../../../services';

@Component({
selector: 'app-system-log',
templateUrl: './system-log.component.html',
Expand Down Expand Up @@ -64,7 +65,7 @@ export class SystemLogComponent implements OnInit {
this.page = 1;
this.tempOffset = this.offset;
}
if (limit === '' || limit == 0 || limit === null || limit === undefined) {
if (limit === '' || limit === 0 || limit === null || limit === undefined) {
limit = this.DEFAULT_LIMIT;
}
this.limit = limit;
Expand Down
Expand Up @@ -44,7 +44,7 @@ export class UpdateUserComponent implements OnInit {
};

// To handle section on UI
if (key == 'role') {
if (key === 'role') {
this.showRoleSection = true;
}
}
Expand Down
Expand Up @@ -61,7 +61,7 @@ export class UserManagementComponent implements OnInit {
this.ngProgress.done();
roleRecord['roles'].filter(role => {
users.forEach(user => {
if (role.id == user.roleId) {
if (role.id === user.roleId) {
user['roleName'] = role.name;
}
});
Expand Down Expand Up @@ -164,7 +164,7 @@ export class UserManagementComponent implements OnInit {

showDiv(id) {
this.seletedTab = 1;
if (id == 2) {
if (id === 2) {
this.seletedTab = id;
}
}
Expand Down
Expand Up @@ -40,7 +40,7 @@ export class UserProfileComponent implements OnInit {
(roleRecord) => {
this.ngProgress.done();
roleRecord['roles'].filter(role => {
if (role.id == userData['roleId']) {
if (role.id === userData['roleId']) {
userData['roleName'] = role.name;
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/app/directives/custom-validator.ts
Expand Up @@ -2,7 +2,7 @@ import { AbstractControl, FormGroup, FormControl } from '@angular/forms';

export class CustomValidator {
static nospaceValidator(control: AbstractControl): { [s: string]: boolean } {
if (control.value && control.value.trim() == '') {
if (control.value && control.value.trim() === '') {
return { nospace: true };
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/schedules.service.ts
@@ -1,4 +1,4 @@
import { HttpClient, HttpParams } from '@angular/common/http';
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { throwError as observableThrowError } from 'rxjs';
import { catchError, map } from 'rxjs/operators';
Expand Down
6 changes: 1 addition & 5 deletions tslint.json
Expand Up @@ -103,7 +103,6 @@
"variable-declaration": "nospace"
}
],
"typeof-compare": true,
"unified-signatures": true,
"variable-name": false,
"whitespace": [
Expand Down Expand Up @@ -132,9 +131,6 @@
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true,
"no-access-missing-member": true,
"templates-use-public": true,
"invoke-injectable": true
"directive-class-suffix": true
}
}
36 changes: 21 additions & 15 deletions yarn.lock
Expand Up @@ -1018,7 +1018,7 @@ buffer@^4.3.0:
ieee754 "^1.1.4"
isarray "^1.0.0"

builtin-modules@^1.0.0:
builtin-modules@^1.0.0, builtin-modules@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"

Expand Down Expand Up @@ -1134,7 +1134,7 @@ chalk@^1.1.1, chalk@^1.1.3:
strip-ansi "^3.0.0"
supports-color "^2.0.0"

chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.2, chalk@^2.4.1:
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.2, chalk@^2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e"
dependencies:
Expand Down Expand Up @@ -1327,7 +1327,7 @@ colors@1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63"

colors@^1.1.0, colors@^1.1.2:
colors@^1.1.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.0.tgz#5f20c9fef6945cb1134260aab33bfbdc8295e04e"

Expand All @@ -1343,10 +1343,14 @@ combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5:
dependencies:
delayed-stream "~1.0.0"

commander@2.16.x, commander@^2.9.0, commander@~2.16.0:
commander@2.16.x, commander@~2.16.0:
version "2.16.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.16.0.tgz#f16390593996ceb4f3eeb020b31d78528f7f8a50"

commander@^2.12.1:
version "2.18.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970"

commander@~2.13.0:
version "2.13.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
Expand Down Expand Up @@ -5976,28 +5980,30 @@ tsickle@^0.29.0:
source-map "^0.6.0"
source-map-support "^0.5.0"

tslib@^1.7.1, tslib@^1.8.1, tslib@^1.9.0:
tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0:
version "1.9.3"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"

tslint@~5.5.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.5.0.tgz#10e8dab3e3061fa61e9442e8cee3982acf20a6aa"
tslint@^5.11.0:
version "5.11.0"
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.11.0.tgz#98f30c02eae3cde7006201e4c33cb08b48581eed"
dependencies:
babel-code-frame "^6.22.0"
colors "^1.1.2"
commander "^2.9.0"
builtin-modules "^1.1.1"
chalk "^2.3.0"
commander "^2.12.1"
diff "^3.2.0"
glob "^7.1.1"
js-yaml "^3.7.0"
minimatch "^3.0.4"
resolve "^1.3.2"
semver "^5.3.0"
tslib "^1.7.1"
tsutils "^2.5.1"
tslib "^1.8.0"
tsutils "^2.27.2"

tsutils@^2.5.1:
version "2.28.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.28.0.tgz#6bd71e160828f9d019b6f4e844742228f85169a1"
tsutils@^2.27.2:
version "2.29.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99"
dependencies:
tslib "^1.8.1"

Expand Down

0 comments on commit 90e2317

Please sign in to comment.