Skip to content

Commit 5d56216

Browse files
AmitMYmanucorporat
authored andcommitted
refactor(): global refactoring to avoid IDE warnings and cleaner code (ionic-team#11296)
* refactor(style): redundant measure units * refactor(): change pointless boolean operation to cast * refactor(): change redundant 'if' statement * refactor(style): remove overwritten property value * fix(spellcheck): wrong attribute value * refactor(datetime-test): There should be a space between attribute and previous attribute * refactor(import): import can be shortened * refactor(semicolon): add missing semicolon * docs(): fix incorrect parameter name * refactor(): remove trailing unused parameters * fix(menu): create mock change signature * refactor(): remove redundant imports all tests are passing * refactor(style): 'var' used instead of 'let' or 'const' * Revert "refactor(style): 'var' used instead of 'let' or 'const'" This reverts commit 0369dbc. * refacrot(): remove unused code * Revert "refactor(style): remove overwritten property value" * revert(hammer): don't modify 3rd party files * revert(activator): follow interface * revert(activator): follow interface (cont) * revert(activator): follow interface (cont) * merge(master): fix conflicts * revert(): change pointless boolean operation to cast * revert(): text align is covered by a different PR * revert(): add back unused parameters * revert(): add back unused parameters
1 parent 3b4b29e commit 5d56216

69 files changed

Lines changed: 115 additions & 144 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/animations/animation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ export class Animation {
501501

502502
const self = this;
503503

504-
function onTransitionEnd(ev: any) {
504+
function onTransitionEnd() {
505505
// congrats! a successful transition completed!
506506
// ensure transition end events and timeouts have been cleared
507507
self._clearAsync();

src/components/action-sheet/action-sheet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class ActionSheet extends ViewController {
6565
/**
6666
* Present the action sheet instance.
6767
*
68-
* @param {NavOptions} [opts={}] Nav options to go with this transition.
68+
* @param {NavOptions} [navOptions={}] Nav options to go with this transition.
6969
* @returns {Promise} Returns a promise which is resolved when the transition has completed.
7070
*/
7171
present(navOptions: NavOptions = {}): Promise<any> {

src/components/alert/alert.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class Alert extends ViewController {
9797
/**
9898
* Present the alert instance.
9999
*
100-
* @param {NavOptions} [opts={}] Nav options to go with this transition.
100+
* @param {NavOptions} [navOptions={}] Nav options to go with this transition.
101101
* @returns {Promise} Returns a promise which is resolved when the transition has completed.
102102
*/
103103
present(navOptions: NavOptions = {}): Promise<any> {

src/components/alert/test/basic/pages/page-one/page-one.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ export class PageOne {
292292
let alert = this.alertCtrl.create({
293293
enableBackdropDismiss: false
294294
});
295-
alert.setTitle('Disabled Backdrop Click'),
296-
alert.setMessage('Cannot dismiss alert from clickings the backdrop'),
295+
alert.setTitle('Disabled Backdrop Click');
296+
alert.setMessage('Cannot dismiss alert from clickings the backdrop');
297297
alert.addButton({
298298
text: 'Cancel',
299299
role: 'cancel',

src/components/app/app-root.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export class IonicApp extends Ion implements OnInit {
157157

158158
stopScroll(): Promise<boolean> {
159159
if (this._stopScrollPlugin) {
160-
return new Promise((resolve, reject) => {
160+
return new Promise((resolve) => {
161161
this._stopScrollPlugin.stop(() => resolve(true));
162162
});
163163
} else {

src/components/app/test/animations/app.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, NgModule } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
3-
import { Animation, Config, IonicApp, IonicModule, Platform } from '../../../..';
3+
import { Animation, IonicApp, IonicModule, Platform } from '../../../..';
44

55

66
@Component({
@@ -10,7 +10,7 @@ export class E2EPage {
1010
duration: string;
1111
easing: string;
1212

13-
constructor(config: Config, public plt: Platform) {
13+
constructor(public plt: Platform) {
1414
this.duration = '1000';
1515
this.easing = 'ease-in-out';
1616
}

src/components/checkbox/checkbox.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ChangeDetectorRef, Component, ElementRef, HostListener, Input, OnDestroy, Optional, Renderer, ViewEncapsulation } from '@angular/core';
1+
import { Component, ElementRef, HostListener, Input, OnDestroy, Optional, Renderer, ViewEncapsulation } from '@angular/core';
22
import { NG_VALUE_ACCESSOR } from '@angular/forms';
33

44
import { Config } from '../../config/config';
@@ -85,8 +85,7 @@ export class Checkbox extends BaseInput<boolean> implements IonicTapInput, OnDes
8585
form: Form,
8686
@Optional() item: Item,
8787
elementRef: ElementRef,
88-
renderer: Renderer,
89-
private _cd: ChangeDetectorRef
88+
renderer: Renderer
9089
) {
9190
super(config, elementRef, renderer, 'checkbox', false, form, item, null);
9291
}

src/components/checkbox/test/checkbox.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import { Checkbox } from '../checkbox';
3-
import { mockConfig, mockElementRef, mockRenderer, mockItem, mockChangeDetectorRef } from '../../../util/mock-providers';
3+
import { mockConfig, mockElementRef, mockRenderer, mockItem } from '../../../util/mock-providers';
44
import { commonInputTest, BOOLEAN_CORPUS } from '../../../util/input-tester';
55

66
describe('Checkbox', () => {
@@ -11,8 +11,7 @@ describe('Checkbox', () => {
1111
const elementRef = mockElementRef();
1212
const renderer = mockRenderer();
1313
const item: any = mockItem();
14-
const cd = mockChangeDetectorRef();
15-
const checkbox = new Checkbox(config, null, item, elementRef, renderer, cd);
14+
const checkbox = new Checkbox(config, null, item, elementRef, renderer);
1615

1716
commonInputTest(checkbox, {
1817
defaultValue: false,

src/components/datetime/test/labels/pages/root-page/root-page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<ion-item>
2828
<ion-label floating>Floating</ion-label>
29-
<ion-datetime displayFormat="D MMM YYYY"[(ngModel)]="floating2"></ion-datetime>
29+
<ion-datetime displayFormat="D MMM YYYY" [(ngModel)]="floating2"></ion-datetime>
3030
</ion-item>
3131

3232
<ion-item>

src/components/fab/fab-container.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, ContentChild, ContentChildren, QueryList, ElementRef } from '@angular/core';
1+
import { Component, ContentChild, ContentChildren, QueryList } from '@angular/core';
22

33
import { Platform } from '../../platform/platform';
44
import { UIEventManager } from '../../gestures/ui-event-manager';
@@ -112,7 +112,7 @@ export class FabContainer {
112112
*/
113113
@ContentChildren(FabList) _fabLists: QueryList<FabList>;
114114

115-
constructor(private _elementRef: ElementRef, plt: Platform) {
115+
constructor(plt: Platform) {
116116
this._events = new UIEventManager(plt);
117117
}
118118

0 commit comments

Comments
 (0)