From 460880982cf907226386e8943b09b45c116736a2 Mon Sep 17 00:00:00 2001 From: Gilad Gray Date: Mon, 16 Jan 2017 17:41:50 +0000 Subject: [PATCH 01/10] upgrade package.json to typescript@2.1.5 --- package.json | 2 +- packages/landing/package.json | 2 +- packages/table/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1382764823..fa06159fc7 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "ts-quick-docs": "0.4.0", "tslint": "4.0.1", "tslint-react": "2.0.0", - "typescript": "2.0.10", + "typescript": "2.1.5", "vinyl-source-stream": "1.1.0", "webpack": "1.13.2" }, diff --git a/packages/landing/package.json b/packages/landing/package.json index d3952f8a32..ba422de091 100644 --- a/packages/landing/package.json +++ b/packages/landing/package.json @@ -43,7 +43,7 @@ "style-loader": "0.13.1", "svgo": "0.7.1", "ts-loader": "0.8.2", - "typescript": "2.0.10", + "typescript": "2.1.5", "webpack": "1.13.3" }, "keywords": [ diff --git a/packages/table/package.json b/packages/table/package.json index 619166d423..b97ff8524f 100644 --- a/packages/table/package.json +++ b/packages/table/package.json @@ -36,7 +36,7 @@ "react-addons-test-utils": "15.4.0", "react-dom": "15.4.0", "style-loader": "0.13.1", - "typescript": "2.0.10", + "typescript": "2.1.5", "webpack": "1.13.3" }, "repository": { From cd32723d0fff7a26051071a20231f5576b2ae37b Mon Sep 17 00:00:00 2001 From: Gilad Gray Date: Mon, 16 Jan 2017 17:52:50 +0000 Subject: [PATCH 02/10] refactor Object.assign usages in table also fix some linting issues --- .../table/examples/tableEditableExample.tsx | 6 +- packages/table/preview/index.tsx | 185 +++++++++--------- packages/table/src/common/grid.ts | 2 +- packages/table/src/interactions/resizable.tsx | 2 +- packages/table/src/tableBody.tsx | 2 +- packages/table/test/mocks/table.tsx | 10 +- 6 files changed, 105 insertions(+), 102 deletions(-) diff --git a/packages/table/examples/tableEditableExample.tsx b/packages/table/examples/tableEditableExample.tsx index c6d5542a86..cf23f1df3e 100644 --- a/packages/table/examples/tableEditableExample.tsx +++ b/packages/table/examples/tableEditableExample.tsx @@ -113,8 +113,8 @@ export class TableEditableExample extends BaseExample<{}> { } private setSparseState(stateKey: string, dataKey: string, value: T) { - const values = Object.assign({}, (this.state as any)[stateKey]) as {[key: string]: T}; - values[dataKey] = value; - this.setState({ [stateKey] : values }); + const stateData = (this.state as any)[stateKey] as { [key: string]: T }; + const values = { ...stateData, [dataKey]: value }; + this.setState({ [stateKey]: values }); } } diff --git a/packages/table/preview/index.tsx b/packages/table/preview/index.tsx index e47319c1bd..65c4e70d63 100644 --- a/packages/table/preview/index.tsx +++ b/packages/table/preview/index.tsx @@ -14,8 +14,8 @@ import { Button, Intent, Menu, - MenuItem, MenuDivider, + MenuItem, } from "@blueprintjs/core"; import { @@ -25,10 +25,10 @@ import { CopyCellsMenuItem, EditableCell, EditableName, + HorizontalCellDivider, IColumnHeaderCellProps, IColumnProps, ICoordinateData, - HorizontalCellDivider, IMenuContext, IRegion, JSONFormat, @@ -40,28 +40,26 @@ import { Utils, } from "../src/index"; +// tslint:disable:max-classes-per-file no-console jsx-no-lambda jsx-no-multiline-js + import { Nav } from "./nav"; ReactDOM.render(