Skip to content

Commit

Permalink
Merge pull request #94 from angular-klingon/codeCleaning-issue91
Browse files Browse the repository at this point in the history
bug(fix): Removed deprecated tslint rules
  • Loading branch information
sumitparakh authored Feb 4, 2019
2 parents 963e374 + f162353 commit b4aefc5
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 30 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"publish:all": "lerna publish --skip-git --skip-npm && lerna exec -- npm publish --access=public",
"postinstall": "lerna bootstrap && opencollective-postinstall",
"start:ui": "cd packages/klingon-ui/ && npm start",
"start:ui:lint": "cd packages/klingon-ui/ && npm run lint",
"start:server": "cd packages/klingon-server/ && npm start",
"start:app": "cd packages/klingon-app && npm run start:dev",
"build:website": "cd packages/klingon-website/ && npm run build",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import {
})
export class DropDownComponent implements OnInit {
@Input()
open: boolean = false;
open = false;

ngOnInit() {
}
Expand Down
6 changes: 3 additions & 3 deletions packages/klingon-ui/src/app/_shared/log/log.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit, Input, SimpleChange } from '@angular/core';
import { Component, OnInit, Input, SimpleChange, OnChanges } from '@angular/core';

export interface StdSimpleChange extends SimpleChange {
stderr: { currentValue: string };
Expand All @@ -15,7 +15,7 @@ export interface StdSimpleChange extends SimpleChange {
`,
styleUrls: ['./log.component.css']
})
export class LogComponent implements OnInit {
export class LogComponent implements OnInit, OnChanges {
@Input()
stdout: string;
@Input()
Expand All @@ -36,7 +36,7 @@ export class LogComponent implements OnInit {
this.logs = [];
}

ngOnChanges(r: StdSimpleChange) {
ngOnChanges(r: {[proname: string]: StdSimpleChange}) {
if (r.stderr && r.stderr.currentValue) {
this.logs.push({
text: r.stderr.currentValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ export class TerminalService {
if (!this.pid) {
return;
}
const cols = size.cols;
const rows = size.rows;
const url = environment.scheme + `://` + environment.host + `:` + environment.port + `/terminals/${
this.pid
}/size?cols=${cols}&rows=${rows}`;
}/size?cols=${size.cols}&rows=${size.rows}`;

fetch(url, { method: 'POST' });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class TerminalComponent implements OnInit {
terminalRef: ElementRef;

@Input()
height: string = '100px';
height = '100px';

@Output()
open: EventEmitter<TerminalData>;
Expand Down
6 changes: 2 additions & 4 deletions packages/klingon-ui/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Component, ViewChild } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { OnInit } from '@angular/core/src/metadata/lifecycle_hooks';
import { CliCreateComponent } from './cli/create/create.component';
Expand Down Expand Up @@ -97,7 +96,6 @@ export class AppComponent implements OnInit {
}
}


onDrag(event: DragEvent) {
event.preventDefault();
event.stopPropagation();
Expand All @@ -117,8 +115,8 @@ export class AppComponent implements OnInit {
/**
* Set current directory from server if root directory field is empty
*/
if(data.cwd && !this.appCli.form.value['root-dir']) {
this.appCli.form.patchValue({'root-dir': data.cwd});
if (data.cwd && !this.appCli.form.value['root-dir']) {
this.appCli.form.patchValue({ 'root-dir': data.cwd });
}
}
}
1 change: 0 additions & 1 deletion packages/klingon-ui/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { RouterModule } from '@angular/router';

import { MatModule } from './mat.module';

Expand Down
2 changes: 0 additions & 2 deletions packages/klingon-ui/src/app/cli/build/build.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { FlagsComponent } from './../flags/flags.component';
import { FormControl } from '@angular/forms';
import { CliService } from './../cli.service';
import { FormGroup } from '@angular/forms';
import { Component, OnInit } from '@angular/core';

@Component({
Expand Down
3 changes: 1 addition & 2 deletions packages/klingon-ui/src/app/cli/cli.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';
import { environment } from '../../environments/environment';
Expand Down Expand Up @@ -54,7 +53,7 @@ export class CliService {
return this.runNgCommand('help');
}

runNgCommand(stdin, dir = undefined) {
runNgCommand(stdin, dir?) {
if (this.isConnectionOn) {
this._send(stdin, dir);
}
Expand Down
2 changes: 0 additions & 2 deletions packages/klingon-ui/src/app/cli/create/create.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { FlagsComponent } from './../flags/flags.component';
import { CliService } from './../cli.service';
import { Validators } from '@angular/forms';
import { FormControl } from '@angular/forms';
import { FormGroup } from '@angular/forms';
import { Component, OnInit } from '@angular/core';
import { ImportService } from '../../_shared/utilities/import.service';
Expand Down
3 changes: 0 additions & 3 deletions packages/klingon-ui/src/app/cli/serve/serve.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { FlagsComponent } from './../flags/flags.component';
import { CliService } from './../cli.service';
import { Validators } from '@angular/forms';
import { FormControl } from '@angular/forms';
import { FormGroup } from '@angular/forms';
import { Component, OnInit } from '@angular/core';

@Component({
Expand Down
3 changes: 0 additions & 3 deletions packages/klingon-ui/src/app/cli/test/test.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { FlagsComponent } from './../flags/flags.component';
import { CliService } from './../cli.service';
import { Validators } from '@angular/forms';
import { FormControl } from '@angular/forms';
import { FormGroup } from '@angular/forms';
import { Component, OnInit } from '@angular/core';

@Component({
Expand Down
6 changes: 1 addition & 5 deletions packages/klingon-ui/tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
"variable-declaration": "nospace"
}
],
"typeof-compare": true,
"unified-signatures": true,
"variable-name": false,
"whitespace": [
Expand Down Expand Up @@ -133,9 +132,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
}
}

0 comments on commit b4aefc5

Please sign in to comment.