Feature/upgrade typescript (#2618)

Upgrade typescript to v3.1 & tslint (was dependent on some deprecated methods of the old version of ts) also fix associated type errors

Next up Im gonna try to use the project references feature of ts 3.0 to see if building all the various oni sub-projects can be simplified
This commit is contained in:
Akin 2018-10-08 21:19:28 +01:00 committed by GitHub
parent c67d39cc59
commit a4d877b967
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 26 deletions

View File

@ -146,7 +146,7 @@ export class CanvasRenderer implements INeovimRenderer {
row.forEach((span: ISpan) => {
// All spans that have changed in current rendering pass
const rowIndex = Number.parseInt(y)
const rowIndex = Number.parseInt(y, 10)
const currentCell = screenInfo.getCell(span.startX, rowIndex)

View File

@ -144,8 +144,8 @@ class Recorder implements Oni.Recorder {
const toArrayBuffer = async (blob: Blob): Promise<ArrayBuffer> => {
return new Promise<ArrayBuffer>((resolve, reject) => {
const fileReader = new FileReader()
fileReader.onload = function() {
const arrayBuffer = this.result
fileReader.onload = evt => {
const arrayBuffer = fileReader.result as ArrayBuffer
resolve(arrayBuffer)
}
fileReader.readAsArrayBuffer(blob)

View File

@ -63,8 +63,6 @@ class WildMenu extends React.Component<Props, State> {
currentPage: 1,
itemsPerPage: 10,
}
private selectedElement: HTMLUListElement
private containerElement: HTMLUListElement
public componentWillReceiveProps(next: Props) {
if (next.selected !== this.props.selected) {
@ -80,16 +78,10 @@ class WildMenu extends React.Component<Props, State> {
return (
visible && (
<WildMenuList innerRef={e => (this.containerElement = e)}>
<WildMenuList>
{currentItems &&
currentItems.map((option, i) => (
<WildMenuItem
innerRef={e =>
i === current - 1 ? (this.selectedElement = e) : null
}
selected={i === current}
key={option + i}
>
<WildMenuItem selected={i === current} key={option + i}>
<span>
<Icon name="file-text" />
</span>

View File

@ -886,7 +886,7 @@
"shelljs": "0.7.7",
"simple-git": "^1.92.0",
"styled-components": "^3.4.4",
"typescript": "^2.8.1",
"typescript": "^3.1.1",
"vscode-css-languageserver-bin": "^1.2.1",
"vscode-html-languageserver-bin": "^1.1.0",
"vscode-jsonrpc": "3.5.0",
@ -998,7 +998,7 @@
"sudo-prompt": "7.1.1",
"ts-jest": "^23.0.0",
"ts-loader": "^4.2.0",
"tslint": "5.9.1",
"tslint": "^5.11.0",
"typescript-plugin-styled-components": "^0.0.6",
"vscode-snippet-parser": "0.0.5",
"wcwidth": "1.0.1",

View File

@ -93,7 +93,7 @@ declare var require: any
const tagsToCollect = ["a", "input", "textarea"]
tagsToCollect.forEach(tag => {
const elems = document.getElementsByTagName(tag) as NodeListOf<HTMLElement>
const elems = document.getElementsByTagName(tag) as HTMLCollectionOf<HTMLElement>
for (let i = 0; i < elems.length; i++) {
addElement(elems[i])

View File

@ -10547,9 +10547,9 @@ tslib@^1.8.0, tslib@^1.8.1:
version "1.9.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8"
tslint@5.9.1:
version "5.9.1"
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.9.1.tgz#1255f87a3ff57eb0b0e1f0e610a8b4748046c9ae"
tslint@^5.11.0:
version "5.11.0"
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.11.0.tgz#98f30c02eae3cde7006201e4c33cb08b48581eed"
dependencies:
babel-code-frame "^6.22.0"
builtin-modules "^1.1.1"
@ -10562,11 +10562,11 @@ tslint@5.9.1:
resolve "^1.3.2"
semver "^5.3.0"
tslib "^1.8.0"
tsutils "^2.12.1"
tsutils "^2.27.2"
tsutils@^2.12.1:
version "2.19.1"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.19.1.tgz#76d7ebdea9d7a7bf4a05f50ead3701b0168708d7"
tsutils@^2.27.2:
version "2.29.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99"
dependencies:
tslib "^1.8.1"
@ -10614,9 +10614,9 @@ typescript-plugin-styled-components@^0.0.6:
dependencies:
ts-is-kind "^1.0.0"
typescript@^2.8.1:
version "2.8.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.1.tgz#6160e4f8f195d5ba81d4876f9c0cc1fbc0820624"
typescript@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.1.tgz#3362ba9dd1e482ebb2355b02dfe8bcd19a2c7c96"
ua-parser-js@^0.7.9:
version "0.7.17"