Skip to content

Commit

Permalink
feat: support more strict tslint (NG-ZORRO#2165)
Browse files Browse the repository at this point in the history
  • Loading branch information
vthinkxie authored and wilsoncook committed Oct 6, 2018
1 parent ccbfbec commit e2aaccd
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 41 deletions.
6 changes: 5 additions & 1 deletion components/steps/nz-steps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,17 @@ export class NzTestInnerStepTemplateComponent {
selector: 'nz-test-step-for',
template: `
<nz-steps>
<nz-step *ngFor="let step of steps"></nz-step>
<nz-step *ngFor="let step of steps;trackBy: trackById"></nz-step>
</nz-steps>
`
})
export class NzTestStepForComponent {
steps = [ 1, 2, 3 ];

trackById(index: number): number {
return index;
}

updateSteps(): void {
this.steps.push(4);
}
Expand Down
4 changes: 2 additions & 2 deletions components/time-picker/nz-time-value-accessor.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class NzTimeValueAccessorDirective implements ControlValueAccessor {

private _onChange: (value: Date) => void;
private _onTouch: () => void;
@Input('nzTime') format: string;
@Input() nzTime: string;

@HostListener('keyup')
keyup(): void {
Expand Down Expand Up @@ -46,7 +46,7 @@ export class NzTimeValueAccessorDirective implements ControlValueAccessor {
}

writeValue(value: Date): void {
this.elementRef.nativeElement.value = this.i18n.formatDate(value, this.format);
this.elementRef.nativeElement.value = this.i18n.formatDate(value, this.nzTime);
}

registerOnChange(fn: (value: Date) => void): void {
Expand Down
92 changes: 54 additions & 38 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,59 @@
"node_modules/codelyzer"
],
"rules": {
"adjacent-overload-signatures": true,
"banana-in-box": true,
"templates-no-negated-async": true,
"no-life-cycle-call": false,
"prefer-output-readonly": false,
"no-conflicting-life-cycle-hooks": false,
"enforce-component-selector": false,
"prefer-inline-decorator": true,
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": false,
"use-view-encapsulation": false,
"no-attribute-parameter-decorator": true,
"no-output-named-after-standard-event": true,
"no-input-rename": true,
"no-output-rename": true,
"no-output-on-prefix": true,
"no-forward-ref": false,
"no-unused-css": true,
"use-life-cycle-interface": true,
"contextual-life-cycle": true,
"trackBy-function": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true,
"pipe-impure": true,
"angular-whitespace": [
false,
"check-interpolation",
"check-semicolon"
],
"directive-selector": [
true,
"attribute",
[
"nz"
],
[
"camelCase",
"kebab-case"
]
],
"component-selector": [
true,
[
"element",
"attribute"
],
[
"nz",
"test"
],
"kebab-case"
],
"callable-types": true,
"class-name": true,
"comment-format": [
Expand Down Expand Up @@ -202,42 +254,6 @@
"check-type",
"check-typecast",
"check-preblock"
],
"directive-selector": [
true,
"attribute",
[
"nz"
],
[
"camelCase",
"kebab-case"
]
],
"component-selector": [
true,
[
"element",
"attribute"
],
[
"nz",
"test"
],
"kebab-case"
],
"angular-whitespace": [
false,
"check-interpolation",
"check-semicolon"
],
"no-output-on-prefix": true,
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": false,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true
]
}
}

0 comments on commit e2aaccd

Please sign in to comment.