Skip to content

Commit 39ef126

Browse files
author
Mohsen Azimi
committed
Upgrade to TypeScript 2.4 as well as other dependencies
1 parent 822c2e9 commit 39ef126

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@
3030
"license": "Apache-2.0",
3131
"dependencies": {
3232
"chalk": "^1.1.3",
33-
"commander": "^2.9.0",
33+
"commander": "^2.10.0",
3434
"glob": "^7.1.2",
35-
"typescript": "^2.3.2"
35+
"typescript": "^2.4.0"
3636
},
3737
"devDependencies": {
3838
"@types/chalk": "^0.4.31",
39-
"@types/commander": "^2.9.0",
39+
"@types/commander": "^2.9.1",
4040
"@types/glob": "^5.0.30",
41-
"@types/jest": "^19.2.3",
42-
"@types/node": "^7.0.12",
43-
"@types/react": "^15.0.21",
44-
"jest": "^20.0.0",
45-
"ts-jest": "^20.0.1",
46-
"ts-node": "^3.0.2",
41+
"@types/jest": "^20.0.2",
42+
"@types/node": "^8.0.2",
43+
"@types/react": "^15.0.31",
44+
"jest": "^20.0.4",
45+
"ts-jest": "^20.0.6",
46+
"ts-node": "^3.1.0",
4747
"tslint": "^5.2.0"
4848
}
4949
}

src/compiler.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ export function compile(filePath: string, factoryFactories: TransformFactoryFact
2828
======================= Diagnostics for ${filePath} =======================
2929
`));
3030
for (const diag of result.diagnostics) {
31-
const pos = diag.file.getLineAndCharacterOfPosition(diag.start);
32-
console.log(`(${pos.line}, ${pos.character}) ${diag.messageText}`)
31+
if (diag.file && diag.start) {
32+
const pos = diag.file.getLineAndCharacterOfPosition(diag.start);
33+
console.log(`(${pos.line}, ${pos.character}) ${diag.messageText}`)
34+
}
3335
}
3436
}
3537

src/transforms/react-js-make-props-and-state-transform.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ export function reactJSMakePropsAndStateInterfaceTransformFactoryFactory(typeChe
222222
console.warn('Bad value for propType', name, 'at', propertyAssignment.getStart());
223223
return result;
224224
}
225-
const typeValue = getTypeFromReactPropTypeExpression(propertyAssignment.initializer)
226-
const propertySignature = ts.createPropertySignature(name, undefined, typeValue, undefined);
225+
const typeValue = getTypeFromReactPropTypeExpression(propertyAssignment.initializer);
226+
const propertySignature = ts.createPropertySignature([], name, undefined, typeValue, undefined);
227227
result.members.push(propertySignature)
228228
return result;
229229
}, ts.createTypeLiteralNode([]));

0 commit comments

Comments
 (0)