Fix all tslint errors

This commit is contained in:
Rossen Hristov
2017-01-06 12:00:06 +02:00
parent bfab188ba0
commit eb4ac8d109
5 changed files with 9 additions and 17 deletions

View File

@@ -59,17 +59,17 @@ var runTest = function (testInfo: TestInfoEntry) {
}
if (testInfo.isTest) {
duration = (time() - start).toFixed(2);
duration = time() - start;
testInfo.duration = duration;
write(`--- [${testInfo.testName}] OK, duration: ${duration}`, trace.messageType.info);
write(`--- [${testInfo.testName}] OK, duration: ${duration.toFixed(2)}`, trace.messageType.info);
testInfo.isPassed = true;
}
}
catch (e) {
if (testInfo.isTest) {
duration = (time() - start).toFixed(2);
duration = time() - start;
testInfo.duration = duration;
write(`--- [${testInfo.testName}] FAILED: ${e.message}, Stack: ${e.stack}, duration: ${duration}`, trace.messageType.error);
write(`--- [${testInfo.testName}] FAILED: ${e.message}, Stack: ${e.stack}, duration: ${duration.toFixed(2)}`, trace.messageType.error);
testInfo.isPassed = false;
testInfo.errorMessage = e.message;
}

View File

@@ -20,8 +20,6 @@ import {isIOS} from "platform";
import {Label} from "ui/label";
import {LayoutBase} from "ui/layouts/layout-base";
import * as helper from "../helper";
import * as viewModule from "ui/core/view";
import {Page} from "ui/page";
export class LabelTest extends testModule.UITest<LabelModule.Label> {

View File

@@ -1406,7 +1406,7 @@ function transformConverter(value: string): Object {
}
function convertToTransform(value: string): [CssProperty<any, any>, any][] {
let newTransform = value == unsetValue ? { "none": "none" } : transformConverter(value);
let newTransform = value === unsetValue ? { "none": "none" } : transformConverter(value);
let array = [];
let values: Array<string>;
for (let transform in newTransform) {
@@ -1950,7 +1950,7 @@ const fontProperty = new ShorthandProperty<Style, string>({
return `${this.fontStyle} ${this.fontWeight} ${this.fontSize} ${this.fontFamily}`;
},
converter: function (value) {
if (value == unsetValue) {
if (value === unsetValue) {
return [
[fontStyleProperty, unsetValue],
[fontWeightProperty, unsetValue],

View File

@@ -316,7 +316,7 @@ const flexFlowProperty = new ShorthandProperty<Style, string>({
},
converter: function (value: string) {
const properties: [CssProperty<any, any>, any][] = [];
if (value == unsetValue) {
if (value === unsetValue) {
properties.push([flexDirectionProperty, value]);
properties.push([flexWrapProperty, value]);
} else {
@@ -344,7 +344,7 @@ const flexProperty = new ShorthandProperty<Style, string>({
},
converter: function (value: string) {
const properties: [CssProperty<any, any>, any][] = [];
if (value == unsetValue) {
if (value === unsetValue) {
properties.push([flexGrowProperty, value]);
properties.push([flexShrinkProperty, value]);
} else {

View File

@@ -1,5 +1,5 @@
import { ViewBase, resetStyleProperties } from "ui/core/view-base";
import { SyntaxTree, Keyframes, parse as parseCss, Rule, Declaration, Node } from "css";
import { SyntaxTree, Keyframes, parse as parseCss, Node } from "css";
import { RuleSet, SelectorsMap, SelectorCore, SelectorsMatch, ChangeMap, fromAstNodes } from "ui/styling/css-selector";
import { KeyframeAnimationInfo, KeyframeAnimation } from "ui/animation/keyframe-animation";
import { write as traceWrite, categories as traceCategories, messageType as traceMessageType } from "trace";
@@ -270,12 +270,6 @@ export function applyInlineStyle(view: ViewBase, style: string) {
}
}
function isRule(node: Node): node is Rule {
return node.type === "rule";
}
function isDeclaration(node: Node): node is Declaration {
return node.type === "declaration";
}
function isKeyframe(node: Node): node is Keyframes {
return node.type === "keyframes";
}