mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Fix all tslint errors
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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> {
|
||||
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user