style(components): fix lint errors

This commit is contained in:
Brandy Carney
2018-01-10 14:50:25 -05:00
parent 835175c43c
commit 88cad7120b
9 changed files with 65 additions and 65 deletions

View File

@ -141,7 +141,7 @@ export class Animator {
* Add the "to" value for a specific property. * Add the "to" value for a specific property.
*/ */
to(prop: string, val: any, clearProperyAfterTransition?: boolean): Animator { to(prop: string, val: any, clearProperyAfterTransition?: boolean): Animator {
let fx = this._addProp('to', prop, val); const fx = this._addProp('to', prop, val);
if (clearProperyAfterTransition) { if (clearProperyAfterTransition) {
// if this effect is a transform then clear the transform effect // if this effect is a transform then clear the transform effect
@ -178,7 +178,7 @@ export class Animator {
if (!fxProp) { if (!fxProp) {
// first time we've see this EffectProperty // first time we've see this EffectProperty
let shouldTrans = (TRANSFORM_PROPS[prop] === 1); const shouldTrans = (TRANSFORM_PROPS[prop] === 1);
fxProp = { fxProp = {
effectName: prop, effectName: prop,
trans: shouldTrans, trans: shouldTrans,
@ -190,7 +190,7 @@ export class Animator {
} }
// add from/to EffectState to the EffectProperty // add from/to EffectState to the EffectProperty
let fxState: EffectState = { const fxState: EffectState = {
val: val, val: val,
num: null, num: null,
effectUnit: '', effectUnit: '',
@ -198,8 +198,8 @@ export class Animator {
fxProp[state] = fxState; fxProp[state] = fxState;
if (typeof val === 'string' && val.indexOf(' ') < 0) { if (typeof val === 'string' && val.indexOf(' ') < 0) {
let r = val.match(CSS_VALUE_REGEX); const r = val.match(CSS_VALUE_REGEX);
let num = parseFloat(r[1]); const num = parseFloat(r[1]);
if (!isNaN(num)) { if (!isNaN(num)) {
fxState.num = num; fxState.num = num;
@ -313,7 +313,7 @@ export class Animator {
* Play the animation. * Play the animation.
*/ */
play(opts?: PlayOptions) { play(opts?: PlayOptions) {
let self = this; const self = this;
// If the animation was already invalidated (it did finish), do nothing // If the animation was already invalidated (it did finish), do nothing
if (self._destroyed) { if (self._destroyed) {
@ -349,7 +349,7 @@ export class Animator {
syncPlay() { syncPlay() {
// If the animation was already invalidated (it did finish), do nothing // If the animation was already invalidated (it did finish), do nothing
if (!this._destroyed) { if (!this._destroyed) {
let opts = { duration: 0 }; const opts = { duration: 0 };
this._isAsync = false; this._isAsync = false;
this._clearAsync(); this._clearAsync();
this._playInit(opts); this._playInit(opts);
@ -371,7 +371,7 @@ export class Animator {
this.hasCompleted = false; this.hasCompleted = false;
this._hasDur = (this.getDuration(opts) > DURATION_MIN); this._hasDur = (this.getDuration(opts) > DURATION_MIN);
let children = this._childAnimations; const children = this._childAnimations;
for (let i = 0; i < this._childAnimationTotal; i++) { for (let i = 0; i < this._childAnimationTotal; i++) {
// ******** DOM WRITE **************** // ******** DOM WRITE ****************
children[i]._playInit(opts); children[i]._playInit(opts);
@ -394,7 +394,7 @@ export class Animator {
* ROOT ANIMATION * ROOT ANIMATION
*/ */
_playDomInspect(opts: PlayOptions) { _playDomInspect(opts: PlayOptions) {
let self = this; const self = this;
// fire off all the "before" function that have DOM READS in them // fire off all the "before" function that have DOM READS in them
// elements will be in the DOM, however visibily hidden // elements will be in the DOM, however visibily hidden
// so we can read their dimensions if need be // so we can read their dimensions if need be
@ -405,7 +405,7 @@ export class Animator {
// for the root animation only // for the root animation only
// set the async TRANSITION END event // set the async TRANSITION END event
// and run onFinishes when the transition ends // and run onFinishes when the transition ends
let dur = self.getDuration(opts); const dur = self.getDuration(opts);
if (self._isAsync) { if (self._isAsync) {
self._asyncEnd(dur, true); self._asyncEnd(dur, true);
} }
@ -427,7 +427,7 @@ export class Animator {
* RECURSION * RECURSION
*/ */
_playProgress(opts: PlayOptions) { _playProgress(opts: PlayOptions) {
let children = this._childAnimations; const children = this._childAnimations;
for (let i = 0; i < this._childAnimationTotal; i++) { for (let i = 0; i < this._childAnimationTotal; i++) {
// ******** DOM WRITE **************** // ******** DOM WRITE ****************
children[i]._playProgress(opts); children[i]._playProgress(opts);
@ -460,7 +460,7 @@ export class Animator {
*/ */
_playToStep(stepValue: number) { _playToStep(stepValue: number) {
if (!this._destroyed) { if (!this._destroyed) {
let children = this._childAnimations; const children = this._childAnimations;
for (let i = 0; i < this._childAnimationTotal; i++) { for (let i = 0; i < this._childAnimationTotal; i++) {
// ******** DOM WRITE **************** // ******** DOM WRITE ****************
children[i]._playToStep(stepValue); children[i]._playToStep(stepValue);
@ -482,7 +482,7 @@ export class Animator {
* ROOT ANIMATION * ROOT ANIMATION
*/ */
_asyncEnd(dur: number, shouldComplete: boolean) { _asyncEnd(dur: number, shouldComplete: boolean) {
let self = this; const self = this;
function onTransitionEnd() { function onTransitionEnd() {
// congrats! a successful transition completed! // congrats! a successful transition completed!
@ -527,7 +527,7 @@ export class Animator {
* RECURSION * RECURSION
*/ */
_playEnd(stepValue?: number) { _playEnd(stepValue?: number) {
let children = this._childAnimations; const children = this._childAnimations;
for (let i = 0; i < this._childAnimationTotal; i++) { for (let i = 0; i < this._childAnimationTotal; i++) {
// ******** DOM WRITE **************** // ******** DOM WRITE ****************
children[i]._playEnd(stepValue); children[i]._playEnd(stepValue);
@ -563,7 +563,7 @@ export class Animator {
return true; return true;
} }
let children = this._childAnimations; const children = this._childAnimations;
for (let i = 0; i < this._childAnimationTotal; i++) { for (let i = 0; i < this._childAnimationTotal; i++) {
if (children[i]._hasDuration(opts)) { if (children[i]._hasDuration(opts)) {
return true; return true;
@ -581,7 +581,7 @@ export class Animator {
return true; return true;
} }
let children = this._childAnimations; const children = this._childAnimations;
for (let i = 0; i < this._childAnimationTotal; i++) { for (let i = 0; i < this._childAnimationTotal; i++) {
if (children[i]._hasDomReads()) { if (children[i]._hasDomReads()) {
return true; return true;
@ -620,8 +620,8 @@ export class Animator {
_progress(stepValue: number) { _progress(stepValue: number) {
// bread 'n butter // bread 'n butter
let val: any; let val: any;
let effects = this._fxProperties; const effects = this._fxProperties;
let nuElements = this._elementTotal; const nuElements = this._elementTotal;
if (!effects || !nuElements || this._destroyed) { if (!effects || !nuElements || this._destroyed) {
return; return;
@ -634,16 +634,16 @@ export class Animator {
let i = 0; let i = 0;
let j = 0; let j = 0;
let finalTransform = ''; let finalTransform = '';
let elements = this._elements; const elements = this._elements;
let fx: EffectProperty; let fx: EffectProperty;
for (i = 0; i < effects.length; i++) { for (i = 0; i < effects.length; i++) {
fx = effects[i]; fx = effects[i];
if (fx.from && fx.to) { if (fx.from && fx.to) {
let fromNum = fx.from.num; const fromNum = fx.from.num;
let toNum = fx.to.num; const toNum = fx.to.num;
let tweenEffect = (fromNum !== toNum); const tweenEffect = (fromNum !== toNum);
if (tweenEffect) { if (tweenEffect) {
this._hasTweenEffect = true; this._hasTweenEffect = true;
@ -660,7 +660,7 @@ export class Animator {
} else if (tweenEffect) { } else if (tweenEffect) {
// EVERYTHING IN BETWEEN // EVERYTHING IN BETWEEN
let valNum = (((toNum - fromNum) * stepValue) + fromNum); let valNum = (((toNum - fromNum) * stepValue) + fromNum);
let unit = fx.to.effectUnit; const unit = fx.to.effectUnit;
if (unit === 'px') { if (unit === 'px') {
valNum = Math.round(valNum); valNum = Math.round(valNum);
} }
@ -668,7 +668,7 @@ export class Animator {
} }
if (val !== null) { if (val !== null) {
let prop = fx.effectName; const prop = fx.effectName;
if (fx.trans) { if (fx.trans) {
finalTransform += prop + '(' + val + ') '; finalTransform += prop + '(' + val + ') ';
@ -706,12 +706,12 @@ export class Animator {
} }
// set the TRANSITION properties inline on the element // set the TRANSITION properties inline on the element
let elements = this._elements; const elements = this._elements;
let easing = (forcedLinearEasing ? 'linear' : this.getEasing()); const easing = (forcedLinearEasing ? 'linear' : this.getEasing());
let durString = dur + 'ms'; const durString = dur + 'ms';
let cssTransform = CSS_PROP.transitionProp; const cssTransform = CSS_PROP.transitionProp;
let cssTransitionDuration = CSS_PROP.transitionDurationProp; const cssTransitionDuration = CSS_PROP.transitionDurationProp;
let cssTransitionTimingFn = CSS_PROP.transitionTimingFnProp; const cssTransitionTimingFn = CSS_PROP.transitionTimingFnProp;
let eleStyle: any; let eleStyle: any;
for (let i = 0; i < this._elementTotal; i++) { for (let i = 0; i < this._elementTotal; i++) {
@ -761,7 +761,7 @@ export class Animator {
*/ */
_setBeforeStyles() { _setBeforeStyles() {
let i: number, j: number; let i: number, j: number;
let children = this._childAnimations; const children = this._childAnimations;
for (i = 0; i < this._childAnimationTotal; i++) { for (i = 0; i < this._childAnimationTotal; i++) {
children[i]._setBeforeStyles(); children[i]._setBeforeStyles();
} }
@ -771,8 +771,8 @@ export class Animator {
if (this._isReverse) { if (this._isReverse) {
return; return;
} }
let addClasses = this._beforeAddClasses; const addClasses = this._beforeAddClasses;
let removeClasses = this._beforeRemoveClasses; const removeClasses = this._beforeRemoveClasses;
let elm: HTMLElement; let elm: HTMLElement;
let elementClassList: DOMTokenList; let elementClassList: DOMTokenList;
@ -812,7 +812,7 @@ export class Animator {
* RECURSION * RECURSION
*/ */
_fireBeforeReadFunc() { _fireBeforeReadFunc() {
let children = this._childAnimations; const children = this._childAnimations;
let i = 0; let i = 0;
for (i = 0; i < this._childAnimationTotal; i++) { for (i = 0; i < this._childAnimationTotal; i++) {
@ -820,7 +820,7 @@ export class Animator {
children[i]._fireBeforeReadFunc(); children[i]._fireBeforeReadFunc();
} }
let readFunctions = this._readCallbacks; const readFunctions = this._readCallbacks;
if (readFunctions) { if (readFunctions) {
for (i = 0; i < readFunctions.length; i++) { for (i = 0; i < readFunctions.length; i++) {
// ******** DOM READ **************** // ******** DOM READ ****************
@ -834,7 +834,7 @@ export class Animator {
* RECURSION * RECURSION
*/ */
_fireBeforeWriteFunc() { _fireBeforeWriteFunc() {
let children = this._childAnimations; const children = this._childAnimations;
let i = 0; let i = 0;
for (i = 0; i < this._childAnimationTotal; i++) { for (i = 0; i < this._childAnimationTotal; i++) {
@ -842,7 +842,7 @@ export class Animator {
children[i]._fireBeforeWriteFunc(); children[i]._fireBeforeWriteFunc();
} }
let writeFunctions = this._writeCallbacks; const writeFunctions = this._writeCallbacks;
if (this._writeCallbacks) { if (this._writeCallbacks) {
for (i = 0; i < writeFunctions.length; i++) { for (i = 0; i < writeFunctions.length; i++) {
// ******** DOM WRITE **************** // ******** DOM WRITE ****************
@ -858,7 +858,7 @@ export class Animator {
let i: number, j: number; let i: number, j: number;
let elm: HTMLElement; let elm: HTMLElement;
let elementClassList: DOMTokenList; let elementClassList: DOMTokenList;
let elements = this._elements; const elements = this._elements;
let prop: string; let prop: string;
for (i = 0; i < this._elementTotal; i++) { for (i = 0; i < this._elementTotal; i++) {
@ -933,13 +933,13 @@ export class Animator {
_willChange(addWillChange: boolean) { _willChange(addWillChange: boolean) {
let i = 0; let i = 0;
let wc: string[]; let wc: string[];
let effects = this._fxProperties; const effects = this._fxProperties;
let willChange: string; let willChange: string;
if (addWillChange && effects) { if (addWillChange && effects) {
wc = []; wc = [];
for (i = 0; i < effects.length; i++) { for (i = 0; i < effects.length; i++) {
let propWC = effects[i].wc; const propWC = effects[i].wc;
if (propWC === 'webkitTransform') { if (propWC === 'webkitTransform') {
wc.push('transform', '-webkit-transform'); wc.push('transform', '-webkit-transform');
@ -978,7 +978,7 @@ export class Animator {
* RECURSION * RECURSION
*/ */
_progressStart() { _progressStart() {
let children = this._childAnimations; const children = this._childAnimations;
for (let i = 0; i < this._childAnimationTotal; i++) { for (let i = 0; i < this._childAnimationTotal; i++) {
// ******** DOM WRITE **************** // ******** DOM WRITE ****************
children[i]._progressStart(); children[i]._progressStart();
@ -999,7 +999,7 @@ export class Animator {
// only update if the last update was more than 16ms ago // only update if the last update was more than 16ms ago
stepValue = Math.min(1, Math.max(0, stepValue)); stepValue = Math.min(1, Math.max(0, stepValue));
let children = this._childAnimations; const children = this._childAnimations;
for (let i = 0; i < this._childAnimationTotal; i++) { for (let i = 0; i < this._childAnimationTotal; i++) {
// ******** DOM WRITE **************** // ******** DOM WRITE ****************
children[i].progressStep(stepValue); children[i].progressStep(stepValue);
@ -1013,7 +1013,7 @@ export class Animator {
* End the progress animation. * End the progress animation.
*/ */
progressEnd(shouldComplete: boolean, currentStepValue: number, dur: number) { progressEnd(shouldComplete: boolean, currentStepValue: number, dur: number) {
let self = this; const self = this;
if (dur === undefined) { if (dur === undefined) {
dur = -1; dur = -1;
} }
@ -1023,9 +1023,9 @@ export class Animator {
// flip the step value: 0 becomes 1, 1 becomes 0 // flip the step value: 0 becomes 1, 1 becomes 0
currentStepValue = ((currentStepValue * -1) + 1); currentStepValue = ((currentStepValue * -1) + 1);
} }
let stepValue = shouldComplete ? 1 : 0; const stepValue = shouldComplete ? 1 : 0;
let diff = Math.abs(currentStepValue - stepValue); const diff = Math.abs(currentStepValue - stepValue);
if (diff < 0.05) { if (diff < 0.05) {
dur = 0; dur = 0;
} else if (dur < 0) { } else if (dur < 0) {
@ -1058,7 +1058,7 @@ export class Animator {
* RECURSION * RECURSION
*/ */
_progressEnd(shouldComplete: boolean, stepValue: number, dur: number, isAsync: boolean) { _progressEnd(shouldComplete: boolean, stepValue: number, dur: number, isAsync: boolean) {
let children = this._childAnimations; const children = this._childAnimations;
for (let i = 0; i < this._childAnimationTotal; i++) { for (let i = 0; i < this._childAnimationTotal; i++) {
// ******** DOM WRITE **************** // ******** DOM WRITE ****************
children[i]._progressEnd(shouldComplete, stepValue, dur, isAsync); children[i]._progressEnd(shouldComplete, stepValue, dur, isAsync);
@ -1108,7 +1108,7 @@ export class Animator {
* RECURSION * RECURSION
*/ */
_didFinishAll(hasCompleted: boolean, finishAsyncAnimations: boolean, finishNoDurationAnimations: boolean) { _didFinishAll(hasCompleted: boolean, finishAsyncAnimations: boolean, finishNoDurationAnimations: boolean) {
let children = this._childAnimations; const children = this._childAnimations;
for (let i = 0; i < this._childAnimationTotal; i++) { for (let i = 0; i < this._childAnimationTotal; i++) {
children[i]._didFinishAll(hasCompleted, finishAsyncAnimations, finishNoDurationAnimations); children[i]._didFinishAll(hasCompleted, finishAsyncAnimations, finishNoDurationAnimations);
} }
@ -1149,7 +1149,7 @@ export class Animator {
if (shouldReverse === undefined) { if (shouldReverse === undefined) {
shouldReverse = true; shouldReverse = true;
} }
let children = this._childAnimations; const children = this._childAnimations;
for (let i = 0; i < this._childAnimationTotal; i++) { for (let i = 0; i < this._childAnimationTotal; i++) {
children[i].reverse(shouldReverse); children[i].reverse(shouldReverse);
} }
@ -1163,7 +1163,7 @@ export class Animator {
destroy() { destroy() {
this._destroyed = true; this._destroyed = true;
let children = this._childAnimations; const children = this._childAnimations;
for (let i = 0; i < this._childAnimationTotal; i++) { for (let i = 0; i < this._childAnimationTotal; i++) {
children[i].destroy(); children[i].destroy();
} }

View File

@ -1,6 +1,6 @@
export let CSS_PROP = function(docEle: HTMLElement) { export let CSS_PROP = function(docEle: HTMLElement) {
let css: { const css: {
transformProp?: string; transformProp?: string;
transitionProp?: string; transitionProp?: string;
transitionDurationProp?: string; transitionDurationProp?: string;
@ -28,7 +28,7 @@ export let CSS_PROP = function(docEle: HTMLElement) {
} }
// The only prefix we care about is webkit for transitions. // The only prefix we care about is webkit for transitions.
let prefix = css.transitionProp.indexOf('webkit') > -1 ? '-webkit-' : ''; const prefix = css.transitionProp.indexOf('webkit') > -1 ? '-webkit-' : '';
// transition duration // transition duration
css.transitionDurationProp = prefix + 'transition-duration'; css.transitionDurationProp = prefix + 'transition-duration';

View File

@ -3,7 +3,7 @@
export function transitionEnd(elm: HTMLElement, callback: {(ev?: TransitionEvent): void}) { export function transitionEnd(elm: HTMLElement, callback: {(ev?: TransitionEvent): void}) {
let unRegTrans: Function; let unRegTrans: Function;
let unRegWKTrans: Function; let unRegWKTrans: Function;
let opts: any = { passive: true }; const opts: any = { passive: true };
function unregister() { function unregister() {
unRegWKTrans && unRegWKTrans(); unRegWKTrans && unRegWKTrans();

View File

@ -15,7 +15,7 @@ export class FabList {
const fabs = this.el.querySelectorAll('ion-fab-button'); const fabs = this.el.querySelectorAll('ion-fab-button');
// if showing the fabs add a timeout, else show immediately // if showing the fabs add a timeout, else show immediately
let timeout = activated ? 30 : 0; const timeout = activated ? 30 : 0;
for (let i = 0; i < fabs.length; i++) { for (let i = 0; i < fabs.length; i++) {
const fab = fabs[i]; const fab = fabs[i];
setTimeout(() => fab.show = activated, i * timeout); setTimeout(() => fab.show = activated, i * timeout);

View File

@ -277,9 +277,9 @@ export class Gesture {
if (startPos > 1) { if (startPos > 1) {
// compute relative movement between these two points // compute relative movement between these two points
let frequency = 1 / (positions[startPos] - timestamp); const frequency = 1 / (positions[startPos] - timestamp);
let movedY = positions[startPos - 1] - currentY; const movedY = positions[startPos - 1] - currentY;
let movedX = positions[startPos - 2] - currentX; const movedX = positions[startPos - 2] - currentX;
// based on XXms compute the movement to apply for each render step // based on XXms compute the movement to apply for each render step
// velocity = space/time = s*(1/t) = s*frequency // velocity = space/time = s*(1/t) = s*frequency

View File

@ -1017,7 +1017,7 @@ export function getEnteringView(ti: TransitionInstruction, nav: Nav, leavingView
return ti.insertViews[ti.insertViews.length - 1]; return ti.insertViews[ti.insertViews.length - 1];
} }
if (isDef(ti.removeStart)) { if (isDef(ti.removeStart)) {
let removeEnd = ti.removeStart + ti.removeCount; const removeEnd = ti.removeStart + ti.removeCount;
for (let i = nav.views.length - 1; i >= 0; i--) { for (let i = nav.views.length - 1; i >= 0; i--) {
if ((i < ti.removeStart || i >= removeEnd) && nav.views[i] !== leavingView) { if ((i < ti.removeStart || i >= removeEnd) && nav.views[i] !== leavingView) {
return nav.views[i]; return nav.views[i];

View File

@ -67,8 +67,8 @@ export class SplitPane {
const nu = this.el.childElementCount; const nu = this.el.childElementCount;
let foundMain = false; let foundMain = false;
for (let i = 0; i < nu; i++) { for (let i = 0; i < nu; i++) {
let child = children[i] as HTMLElement; const child = children[i] as HTMLElement;
let isMain = child.hasAttribute('main'); const isMain = child.hasAttribute('main');
if (isMain) { if (isMain) {
if (foundMain) { if (foundMain) {
console.warn('split pane can not have more than one main node'); console.warn('split pane can not have more than one main node');

View File

@ -85,8 +85,8 @@ export function isPlatformMatch(url: string, userAgent: string, platformName: st
export function queryParam(url: string, key: string) { export function queryParam(url: string, key: string) {
key = key.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); key = key.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
let regex = new RegExp('[\\?&]' + key + '=([^&#]*)'); const regex = new RegExp('[\\?&]' + key + '=([^&#]*)');
let results = regex.exec(url); const results = regex.exec(url);
return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null; return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null;
} }

View File

@ -59,7 +59,7 @@ export function pointerCoordX(ev: any): number {
// get X coordinates for either a mouse click // get X coordinates for either a mouse click
// or a touch depending on the given event // or a touch depending on the given event
if (ev) { if (ev) {
let changedTouches = ev.changedTouches; const changedTouches = ev.changedTouches;
if (changedTouches && changedTouches.length > 0) { if (changedTouches && changedTouches.length > 0) {
return changedTouches[0].clientX; return changedTouches[0].clientX;
} }
@ -76,9 +76,9 @@ export function updateDetail(ev: any, detail: any) {
let x = 0; let x = 0;
let y = 0; let y = 0;
if (ev) { if (ev) {
let changedTouches = ev.changedTouches; const changedTouches = ev.changedTouches;
if (changedTouches && changedTouches.length > 0) { if (changedTouches && changedTouches.length > 0) {
let touch = changedTouches[0]; const touch = changedTouches[0];
x = touch.clientX; x = touch.clientX;
y = touch.clientY; y = touch.clientY;
} else if (ev.pageX !== undefined) { } else if (ev.pageX !== undefined) {
@ -94,7 +94,7 @@ export function pointerCoordY(ev: any): number {
// get Y coordinates for either a mouse click // get Y coordinates for either a mouse click
// or a touch depending on the given event // or a touch depending on the given event
if (ev) { if (ev) {
let changedTouches = ev.changedTouches; const changedTouches = ev.changedTouches;
if (changedTouches && changedTouches.length > 0) { if (changedTouches && changedTouches.length > 0) {
return changedTouches[0].clientY; return changedTouches[0].clientY;
} }