Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit f3205f5

Browse files
Foxandxsswardbell
authored andcommitted
chore: first sweep on linting the codebase
closes #1616
1 parent 7e52648 commit f3205f5

File tree

239 files changed

+701
-688
lines changed

Some content is hidden

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

239 files changed

+701
-688
lines changed

gulpfile.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,15 @@ gulp.task('_zip-examples', function() {
636636
// Linting
637637

638638
gulp.task('lint', function() {
639-
return gulp.src(['./public/docs/_examples/style-guide/ts/**/*.ts', '!./public/docs/_examples/style-guide/ts/**/*.avoid.ts'])
639+
return gulp.src([
640+
'./public/docs/_examples/**/*.ts',
641+
'!./public/docs/_examples/**/ts-snippets/*.ts',
642+
'!./public/docs/_examples/style-guide/ts/**/*.avoid.ts',
643+
'!./public/docs/_examples/**/node_modules/**/*',
644+
'!./public/docs/_examples/_protractor/**/*',
645+
'!./public/docs/_examples/**/typings/**/*',
646+
'!./public/docs/_examples/**/typings-ng1/**/*'
647+
])
640648
.pipe(tslint({
641649
rulesDirectory: ['node_modules/codelyzer'],
642650
configuration: require('./tslint.json')

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"browser-sync": "^2.9.3",
3232
"canonical-path": "0.0.2",
3333
"cross-spawn": "^4.0.0",
34-
"codelyzer": "0.0.20",
34+
"codelyzer": "0.0.22",
3535
"del": "^2.2.0",
3636
"dgeni": "^0.4.0",
3737
"dgeni-packages": "^0.13.0",

public/docs/_examples/architecture/ts/app/backend.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const HEROES = [
1313
export class BackendService {
1414
constructor(private logger: Logger) {}
1515

16-
getAll(type:Type) : PromiseLike<any[]>{
16+
getAll(type: Type): PromiseLike<any[]> {
1717
if (type === Hero) {
1818
// TODO get from the database
1919
return Promise.resolve<Hero[]>(HEROES);

public/docs/_examples/architecture/ts/app/hero-detail.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Input} from '@angular/core';
1+
import { Component, Input } from '@angular/core';
22

33
import { Hero } from './hero';
44

public/docs/_examples/architecture/ts/app/sales-tax.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class SalesTaxComponent {
3535
constructor(private salesTaxService: SalesTaxService) { }
3636
// #enddocregion ctor
3737

38-
getTax(value:string | number){
38+
getTax(value: string | number) {
3939
return this.salesTaxService.getVAT(value);
4040
}
4141
}

public/docs/_examples/architecture/ts/app/sales-tax.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// #docregion
2-
import { Inject, Injectable } from '@angular/core';
2+
import { Inject, Injectable } from '@angular/core';
33

44
import { TaxRateService } from './tax-rate.service';
55

66
// #docregion class
77
@Injectable()
88
export class SalesTaxService {
99
constructor(private rateService: TaxRateService) { }
10-
getVAT(value:string | number){
11-
let amount:number;
12-
if (typeof value === "string"){
10+
getVAT(value: string | number) {
11+
let amount: number;
12+
if (typeof value === 'string') {
1313
amount = parseFloat(value);
1414
} else {
1515
amount = value;

public/docs/_examples/architecture/ts/app/tax-rate.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import { Injectable } from '@angular/core';
44
// #docregion class
55
@Injectable()
66
export class TaxRateService {
7-
getRate(rateName:string){return 0.10;} // always 10% everywhere
7+
getRate(rateName: string) {return 0.10; } // always 10% everywhere
88
}
99
// #enddocregion class

public/docs/_examples/attribute-directives/ts/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ import { HighlightDirective } from './highlight.directive';
1111

1212
export class AppComponent { }
1313

14-
// #enddocregion
14+
// #enddocregion

public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ import { Directive, ElementRef, Input } from '@angular/core';
1414
export class HighlightDirective {
1515

1616
// #docregion ctor
17-
private el:HTMLElement;
17+
private el: HTMLElement;
1818
constructor(el: ElementRef) { this.el = el.nativeElement; }
1919
// #enddocregion ctor
2020

2121
// #docregion mouse-methods
22-
onMouseEnter() { this.highlight("yellow"); }
22+
onMouseEnter() { this.highlight('yellow'); }
2323
onMouseLeave() { this.highlight(null); }
2424

2525
private highlight(color: string) {

public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ import { Directive, ElementRef, Input } from '@angular/core';
1313
export class HighlightDirective {
1414
private _defaultColor = 'red';
1515
private el: HTMLElement;
16-
16+
1717
constructor(el: ElementRef) { this.el = el.nativeElement; }
1818
// #enddocregion class-1
1919

2020
// #docregion defaultColor
21-
@Input() set defaultColor(colorName:string){
21+
@Input() set defaultColor(colorName: string){
2222
this._defaultColor = colorName || this._defaultColor;
2323
}
2424
// #enddocregion defaultColor
@@ -33,7 +33,7 @@ export class HighlightDirective {
3333
// #enddocregion mouse-enter
3434
onMouseLeave() { this.highlight(null); }
3535

36-
private highlight(color:string) {
36+
private highlight(color: string) {
3737
this.el.style.backgroundColor = color;
3838
}
3939
}

0 commit comments

Comments
 (0)