Skip to content

Commit 69af20b

Browse files
committed
lint fixes
1 parent 8b97f06 commit 69af20b

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

.vscode/tasks.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
"taskName": "build",
1212
"args": [],
1313
"isBuildCommand": true,
14-
"problemMatcher": ["$tsc", {
15-
"base": "$tslint5",
16-
"fileLocation": "relative"
17-
}]
14+
"problemMatcher": ["$tsc", "$tslint4"]
1815
}
1916
]
2017
}

grid-view.android.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export class GridView extends GridViewBase {
159159
bottom: nativeView.getPaddingBottom(),
160160
left: nativeView.getPaddingLeft()
161161
};
162+
// tslint:disable-next-line:prefer-object-spread
162163
const newValue = Object.assign(padding, newPadding);
163164
nativeView.setPadding(newValue.left, newValue.top, newValue.right, newValue.bottom);
164165
}
@@ -210,12 +211,13 @@ class GridViewCellHolder extends android.support.v7.widget.RecyclerView.ViewHold
210211

211212
public onClick(v: android.view.View) {
212213
const gridView = this.gridView.get();
213-
gridView.notify({
214+
215+
gridView.notify<GridItemEventData>({
214216
eventName: GridViewBase.itemTapEvent,
215217
object: gridView,
216218
index: this.getAdapterPosition(),
217219
view: this.view
218-
} as GridItemEventData);
220+
});
219221
}
220222

221223
}
@@ -250,12 +252,12 @@ class GridViewAdapter extends android.support.v7.widget.RecyclerView.Adapter {
250252
public onBindViewHolder(vh: GridViewCellHolder, index: number) {
251253
const owner = this.owner.get();
252254

253-
owner.notify({
255+
owner.notify<GridItemEventData>({
254256
eventName: GridViewBase.itemLoadingEvent,
255257
object: owner,
256258
index,
257259
view: vh.view
258-
} as GridItemEventData);
260+
});
259261

260262
vh.view.height = utils.layout.toDeviceIndependentPixels(owner._effectiveRowHeight);
261263

grid-view.ios.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@ export class GridView extends GridViewBase {
164164
view = this._getItemTemplateContent();
165165
}
166166

167-
this.notify({
167+
this.notify<GridItemEventData>({
168168
eventName: GridViewBase.itemLoadingEvent,
169169
object: this,
170170
index: indexPath.row,
171171
view
172-
} as GridItemEventData);
172+
});
173173

174174
// If cell is reused it have old content - remove it first.
175175
if (!cell.view) {
@@ -219,6 +219,7 @@ export class GridView extends GridViewBase {
219219
bottom: this._layout.sectionInset.bottom,
220220
left: this._layout.sectionInset.left
221221
};
222+
// tslint:disable-next-line:prefer-object-spread
222223
const newValue = Object.assign(padding, newPadding);
223224
this._layout.sectionInset =
224225
UIEdgeInsetsFromString(`{${newValue.top},${newValue.left},${newValue.bottom},${newValue.right}}`);
@@ -288,10 +289,10 @@ class UICollectionViewDelegateImpl extends NSObject implements UICollectionViewD
288289
const owner = this._owner.get();
289290

290291
if (indexPath.row === owner.items.length - 1) {
291-
owner.notify({
292+
owner.notify<EventData>({
292293
eventName: GridViewBase.loadMoreItemsEvent,
293294
object: owner
294-
} as EventData);
295+
});
295296
}
296297

297298
if (cell.preservesSuperviewLayoutMargins) {
@@ -307,12 +308,12 @@ class UICollectionViewDelegateImpl extends NSObject implements UICollectionViewD
307308
const cell = collectionView.cellForItemAtIndexPath(indexPath);
308309
const owner = this._owner.get();
309310

310-
owner.notify({
311+
owner.notify<GridItemEventData>({
311312
eventName: GridViewBase.itemTapEvent,
312313
object: owner,
313314
index: indexPath.row,
314315
view: (cell as GridViewCell).view
315-
} as GridItemEventData);
316+
});
316317

317318
cell.highlighted = false;
318319

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
},
3838

3939
"devDependencies": {
40-
"typescript": "~2.2.0",
41-
"tslint": "^5.1.0",
40+
"typescript": "2.2.2",
41+
"tslint": "4.4.2",
4242
"tns-core-modules": "3.1.0",
4343
"tns-platform-declarations": "3.1.0",
4444

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"removeComments": true,
77
"declaration": false,
88
"experimentalDecorators": true,
9+
"noUnusedLocals": true,
910
"target": "es5",
1011
"module": "commonjs",
1112
"outDir": "bin/dist",

tslint.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
true,
2727
{"named-imports-order": "lowercase-last"}
2828
],
29-
"no-unused-variable": [true],
3029
"no-bitwise": false
3130
}
3231
}

0 commit comments

Comments
 (0)