Skip to content

Commit 0193928

Browse files
committed
All files pass linting
1 parent d1a46ae commit 0193928

File tree

88 files changed

+265
-198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+265
-198
lines changed

src/app/base64/directive.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
// todo
1+
// todo

src/app/base64/validator.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ describe('Base64', () => {
66
const error = {base64: true};
77

88
it('"ZGFua29nYWk=" should be base64', () => {
9-
let control = new FormControl('ZGFua29nYWk=');
9+
const control = new FormControl('ZGFua29nYWk=');
1010
expect(base64(control)).toBeNull();
1111
});
1212

1313
it('"ZGFua" should not be base64', () => {
14-
let control = new FormControl('ZGFua');
14+
const control = new FormControl('ZGFua');
1515
expect(base64(control)).toEqual(error);
1616
});
1717
});

src/app/base64/validator.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import { AbstractControl, Validators, ValidatorFn } from '@angular/forms';
33
import { isPresent } from '../util/lang';
44

55
export const base64: ValidatorFn = (control: AbstractControl): {[key: string]: boolean} => {
6-
if (isPresent(Validators.required(control))) return null;
6+
if (isPresent(Validators.required(control))) {
7+
return null;
8+
}
79

8-
let v: string = control.value;
10+
const v: string = control.value;
911
return /^(?:[A-Z0-9+\/]{4})*(?:[A-Z0-9+\/]{2}==|[A-Z0-9+\/]{3}=|[A-Z0-9+\/]{4})$/i.test(v) ? null : {'base64': true};
1012
};

src/app/credit-card/directive.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
// todo
1+
// todo

src/app/credit-card/validator.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ describe('CreditCard', () => {
66
const error = {creditCard: true};
77

88
it('"378282246310005" should be creditCard', () => {
9-
let control = new FormControl('378282246310005');
9+
const control = new FormControl('378282246310005');
1010
expect(creditCard(control)).toBeNull();
1111
});
1212

1313
it('"37828224631000" should not be creditCard', () => {
14-
let control = new FormControl('37828224631000');
14+
const control = new FormControl('37828224631000');
1515
expect(creditCard(control)).toEqual(error);
1616
});
1717

1818
it('"3782822463100056" should not be creditCard', () => {
19-
let control = new FormControl('3782822463100056');
19+
const control = new FormControl('3782822463100056');
2020
expect(creditCard(control)).toEqual(error);
2121
});
2222
});

src/app/credit-card/validator.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@ import { AbstractControl, Validators, ValidatorFn } from '@angular/forms';
33
import { isPresent } from '../util/lang';
44

55
export const creditCard: ValidatorFn = (control: AbstractControl): {[key: string]: boolean} => {
6-
if (isPresent(Validators.required(control))) return null;
6+
if (isPresent(Validators.required(control))) {
7+
return null;
8+
}
79

8-
let v: string = control.value;
10+
const v: string = control.value;
911

10-
let sanitized = v.replace(/[^0-9]+/g, '');
12+
const sanitized = v.replace(/[^0-9]+/g, '');
1113

1214
// problem with chrome
15+
/* tslint:disable */
1316
if (!(/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/.test(sanitized))) {
1417
return {creditCard: true};
1518
}
19+
/* tslint:enable */
1620

1721
let sum = 0;
1822
let digit;

src/app/date-ios/directive.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
// todo
1+
// todo

src/app/date-ios/validator.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ describe('DateISO', () => {
66
const error = {dateISO: true};
77

88
it('"2013-11-12" should be dateISO', () => {
9-
let control = new FormControl('2013-11-12');
9+
const control = new FormControl('2013-11-12');
1010
expect(dateISO(control)).toBeNull();
1111
});
1212

1313
it('"2013-13-12" should not be dateISO', () => {
14-
let control = new FormControl('2013-13-12');
14+
const control = new FormControl('2013-13-12');
1515
expect(dateISO(control)).toEqual(error);
1616
});
1717
});

src/app/date-ios/validator.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import { AbstractControl, Validators, ValidatorFn } from '@angular/forms';
33
import { isPresent, isDate } from '../util/lang';
44

55
export const dateISO: ValidatorFn = (control: AbstractControl): {[key: string]: boolean} => {
6-
if (isPresent(Validators.required(control))) return null;
6+
if (isPresent(Validators.required(control))) {
7+
return null;
8+
}
79

8-
let v: string = control.value;
10+
const v: string = control.value;
911
return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(v) ? null : {dateISO: true};
1012
};

src/app/date/directive.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
// todo
1+
// todo

0 commit comments

Comments
 (0)