Skip to content

Commit

Permalink
feat(build): enabled tslinting
Browse files Browse the repository at this point in the history
  • Loading branch information
valorkin committed Apr 25, 2016
1 parent 14d8ea7 commit 4718b0f
Show file tree
Hide file tree
Showing 13 changed files with 256 additions and 320 deletions.
2 changes: 1 addition & 1 deletion components/select/common.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function escapeRegexp(queryToEscape:string) {
export function escapeRegexp(queryToEscape:string):string {
return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
}
2 changes: 1 addition & 1 deletion components/select/select-interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface IOptionsBehavior {
export interface OptionsBehavior {
first():any;
last():any;
prev():any;
Expand Down
7 changes: 2 additions & 5 deletions components/select/select-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ export class SelectItem {
public children:Array<SelectItem>;
public parent:SelectItem;

constructor(source:any) {
public constructor(source:any) {
if (typeof source === 'string') {
this.id = this.text = source;
}

if (typeof source === 'object') {
this.id = source.id || source.text;
this.text = source.text;

if (source.children && source.text) {
this.children = source.children.map((c:any) => {
let r:SelectItem = new SelectItem(c);
Expand All @@ -26,10 +24,9 @@ export class SelectItem {

public fillChildrenHash(optionsMap:Map<string, number>, startIndex:number):number {
let i = startIndex;
this.children.map(child => {
this.children.map((child:SelectItem) => {
optionsMap.set(child.id, i++);
});

return i;
}

Expand Down
8 changes: 4 additions & 4 deletions components/select/select-pipes.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {Pipe} from 'angular2/core';
import {Pipe, PipeTransform} from 'angular2/core';
import {escapeRegexp} from './common';

@Pipe({
name: 'highlight'
})
export class HighlightPipe {
transform(value:string, args:any[]) {
export class HighlightPipe implements PipeTransform {
public transform(value:string, args:any[]):any {
if (args.length < 1) {
return value;
}
Expand All @@ -30,7 +30,7 @@ export class HighlightPipe {

}

export function stripTags(input:string) {
export function stripTags(input:string):string {
let tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,
commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
return input.replace(commentsAndPhpTags, '').replace(tags, '');
Expand Down
Loading

0 comments on commit 4718b0f

Please sign in to comment.