From 1f243704977f8d8902eae3df8e4cc715b5133556 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Tue, 4 Sep 2018 23:56:36 +0200 Subject: [PATCH] chore(): update tslint --- core/package.json | 2 +- core/src/components/animation-controller/animator.tsx | 2 +- core/src/components/menu/menu.tsx | 2 +- core/src/utils/theme.ts | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/package.json b/core/package.json index 20e5ed6709..fd66bcc173 100644 --- a/core/package.json +++ b/core/package.json @@ -42,7 +42,7 @@ "stylelint": "^9.4.0", "stylelint-order": "^0.8.1", "tslint": "^5.10.0", - "tslint-ionic-rules": "0.0.17", + "tslint-ionic-rules": "0.0.18", "tslint-react": "^3.6.0", "typescript": "^2.9.2", "yargs": "^12.0.1" diff --git a/core/src/components/animation-controller/animator.tsx b/core/src/components/animation-controller/animator.tsx index 1e555d9f9a..5386397d87 100644 --- a/core/src/components/animation-controller/animator.tsx +++ b/core/src/components/animation-controller/animator.tsx @@ -25,7 +25,7 @@ export const TRANSFORM_PROPS: {[key: string]: number} = { 'perspective': 1 }; -const raf = window.requestAnimationFrame +const raf = (window as any).requestAnimationFrame ? window.requestAnimationFrame.bind(window) : (f: FrameRequestCallback) => f(Date.now()); diff --git a/core/src/components/menu/menu.tsx b/core/src/components/menu/menu.tsx index 301da91bca..bfef3cebd9 100644 --- a/core/src/components/menu/menu.tsx +++ b/core/src/components/menu/menu.tsx @@ -61,7 +61,7 @@ export class Menu implements MenuI { typeChanged(type: string, oldType: string | undefined) { const contentEl = this.contentEl; if (contentEl) { - if (oldType) { + if (oldType !== undefined) { contentEl.classList.remove(`menu-content-${oldType}`); } contentEl.classList.add(`menu-content-${type}`); diff --git a/core/src/utils/theme.ts b/core/src/utils/theme.ts index d106c5e5a9..9bf0d621d5 100644 --- a/core/src/utils/theme.ts +++ b/core/src/utils/theme.ts @@ -1,4 +1,4 @@ -import { CssClassMap, Mode, RouterDirection } from '../interface'; +import { Color, CssClassMap, Mode, RouterDirection } from '../interface'; export function hostContext(selector: string, el: HTMLElement): boolean { return !!el.closest(selector); @@ -7,8 +7,8 @@ export function hostContext(selector: string, el: HTMLElement): boolean { /** * Create the mode and color classes for the component based on the classes passed in */ -export function createColorClasses(color: string | undefined): CssClassMap | undefined { - return (color !== undefined) ? { +export function createColorClasses(color: Color | undefined | null): CssClassMap | undefined { + return (color != null) ? { 'ion-color': true, [`ion-color-${color}`]: true } : undefined;