Skip to content

Commit

Permalink
fix(lint): fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuri committed Feb 8, 2017
1 parent 31e226e commit bab50bd
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 1,937 deletions.
29 changes: 16 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"dev": "tsc --watch",
"build": "./node_modules/.bin/ngc -p tsconfig.json",
"prepublish": "npm run build",
"lint": "tslint \"src/**/*.ts\"",
"docs": "gulp docs",
"changelog": "gulp changelog"
},
Expand All @@ -26,22 +27,24 @@
"uploader"
],
"devDependencies": {
"@angular/common": "^2.4.2",
"@angular/compiler": "^2.4.2",
"@angular/compiler-cli": "^2.4.2",
"@angular/core": "^2.4.2",
"@angular/platform-browser": "^2.4.2",
"@angular/platform-browser-dynamic": "^2.4.2",
"@angular/platform-server": "^2.4.2",
"@angular/common": "^2.4.6",
"@angular/compiler": "^2.4.6",
"@angular/compiler-cli": "^2.4.6",
"@angular/core": "^2.4.6",
"@angular/platform-browser": "^2.4.6",
"@angular/platform-browser-dynamic": "^2.4.6",
"@angular/platform-server": "^2.4.6",
"@types/core-js": "^0.9.35",
"@types/node": "^6.0.58",
"@types/node": "^7.0.5",
"codelyzer": "^2.0.0",
"gulp": "^3.9.1",
"gulp-conventional-changelog": "^1.1.0",
"gulp-typedoc": "^2.0.1",
"gulp-typedoc": "^2.0.2",
"reflect-metadata": "^0.1.9",
"rxjs": "^5.0.3",
"typedoc": "^0.5.3",
"typescript": "2.1.4",
"zone.js": "^0.7.4"
"rxjs": "^5.1.0",
"tslint": "^4.4.2",
"typedoc": "^0.5.5",
"typescript": "2.1.5",
"zone.js": "^0.7.6"
}
}
4 changes: 2 additions & 2 deletions src/classes/upload-rejected.class.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export class UploadRejected {
public static get EXTENSION_NOT_ALLOWED():string { return 'ExtensionNotAllowed'; }
public static get MAX_SIZE_EXCEEDED():string { return 'MaxSizeExceeded'; }
public static get EXTENSION_NOT_ALLOWED(): string { return 'ExtensionNotAllowed'; }
public static get MAX_SIZE_EXCEEDED(): string { return 'MaxSizeExceeded'; }

file: any;
reason: string;
Expand Down
12 changes: 6 additions & 6 deletions src/directives/ng-file-drop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class NgFileDropDirective implements OnChanges, OnInit {
@Input() events: EventEmitter<any>;
@Output() onUpload: EventEmitter<any> = new EventEmitter();
@Output() onPreviewData: EventEmitter<any> = new EventEmitter();
@Output() onFileOver:EventEmitter<any> = new EventEmitter();
@Output() onFileOver: EventEmitter<any> = new EventEmitter();
@Output() onUploadRejected: EventEmitter<UploadRejected> = new EventEmitter<UploadRejected>();
@Output() beforeUpload: EventEmitter<UploadedFile> = new EventEmitter<UploadedFile>();

Expand All @@ -38,7 +38,7 @@ export class NgFileDropDirective implements OnChanges, OnInit {
this.uploader._emitter.subscribe((data: any) => {
this.onUpload.emit(data);
if (data.done && this.files && this.files.length) {
this.files = [].filter.call(this.files, (x: any) => x.name !== data.originalName)
this.files = [].filter.call(this.files, (x: any) => x.name !== data.originalName);
}
});

Expand All @@ -47,7 +47,7 @@ export class NgFileDropDirective implements OnChanges, OnInit {
});

this.uploader._beforeEmitter.subscribe((uploadingFile: UploadedFile) => {
this.beforeUpload.emit(uploadingFile)
this.beforeUpload.emit(uploadingFile);
});

setTimeout(() => {
Expand All @@ -64,7 +64,7 @@ export class NgFileDropDirective implements OnChanges, OnInit {
}

ngOnChanges(changes: {[propName: string]: SimpleChange}) {
if (!this.options) {
if (!this.options || !changes) {
return;
}

Expand Down Expand Up @@ -128,12 +128,12 @@ export class NgFileDropDirective implements OnChanges, OnInit {
}

@HostListener('dragover', ['$event'])
public onDragOver(event:any):void {
public onDragOver() {
this.onFileOver.emit(true);
}

@HostListener('dragleave', ['$event'])
public onDragLeave(event:any):any {
public onDragLeave() {
this.onFileOver.emit(false);
}

Expand Down
6 changes: 3 additions & 3 deletions src/directives/ng-file-select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class NgFileSelectDirective implements OnChanges {
@Inject(NgUploaderService) public uploader: NgUploaderService) { }

ngOnChanges(changes: {[propName: string]: SimpleChange}) {
if (!this.options) {
if (!this.options || !changes) {
return;
}

Expand All @@ -42,7 +42,7 @@ export class NgFileSelectDirective implements OnChanges {
this.uploader._emitter.subscribe((data: any) => {
this.onUpload.emit(data);
if (data.done && this.files && this.files.length) {
this.files = [].filter.call(this.files, (x: any) => x.name !== data.originalName)
this.files = [].filter.call(this.files, (x: any) => x.name !== data.originalName);
}
});

Expand All @@ -51,7 +51,7 @@ export class NgFileSelectDirective implements OnChanges {
});

this.uploader._beforeEmitter.subscribe((uploadingFile: UploadedFile) => {
this.beforeUpload.emit(uploadingFile)
this.beforeUpload.emit(uploadingFile);
});

if (this.events instanceof EventEmitter) {
Expand Down
2 changes: 1 addition & 1 deletion src/services/ngx-uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class NgUploaderService {
}
}

createFileUrl(file: File){
createFileUrl(file: File) {
let reader: FileReader = new FileReader();
reader.addEventListener('load', () => {
this._previewEmitter.emit(reader.result);
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"strictNullChecks": true,
"skipLibCheck": true,
"stripInternal": true,
"noUnusedParameters": true,
"lib": ["es6", "dom"],
"rootDir": ".",
"types": [
Expand Down
98 changes: 98 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"eofline": true,
"forin": true,
"indent": [
true,
"spaces"
],
"label-position": true,
"max-line-length": [
true,
140
],
"member-access": false,
"member-ordering": [
true,
"static-before-instance",
"variables-before-functions"
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-variable": true,
"no-empty": false,
"no-eval": true,
"no-shadowed-variable": true,
"no-string-literal": false,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"quotemark": [
true,
"single"
],
"radix": true,
"semicolon": [
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
"no-input-rename": true,
"no-output-rename": true,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true
}
}
Loading

0 comments on commit bab50bd

Please sign in to comment.