Migrating Ionic 2 to Typescript 2.x

I’m attempting to use D3 with Ionic 2, but in order to use the typings for D3 I must use Typescript 2.x. I’m using Ionic 2.0.0-beta.37. There is a new Typescript Release Candidate which can be seen here in the MFST Blog. How can I migrate my project over to use the Typescript 2?

Editing package.json or using npm i with an explicit version of 2.0.0 should work.

That simple? I’ll try it out.

I did npm install of the new version of typescript. It appears in my node_modules directory, but I still get the errors as if my Ionic project is set to still use the same version of typescript. When looking at my package.json file, I don’t see typescript there as a dev dependency. I see:

*“ionic-gulp-browserify-typescript”: “2.0.0”
*“tslint-ionic-rules”: “^0.0.3”
*“tsify”: “0.16.0”

I went and looked in the tslinkt-ionic-rules node/modules and saw in it’s package.json file:

  • “devDependencies”: {
    “typescript”: “^1.8.10”
    }

I changed the version here, but I get the same error. This is the error that I get:

TypeScript error: /Users/arash1/Projects/brite-front-end/node_modules/@types/d3-axis/index.d.ts(150,30): Error TS1110: Type expected.
TypeScript error: /Users/arash1/Projects/brite-front-end/node_modules/@types/d3-axis/index.d.ts(167,24): Error TS1110: Type expected.
TypeScript error: /Users/arash1/Projects/brite-front-end/node_modules/@types/d3-axis/index.d.ts(173,55): Error TS1110: Type expected.
TypeScript error: /Users/arash1/Projects/brite-front-end/node_modules/@types/d3-axis/index.d.ts(191,24): Error TS1110: Type expected.
TypeScript error: /Users/arash1/Projects/brite-front-end/node_modules/@types/d3-brush/index.d.ts(30,37): Error TS1110: Type expected.
TypeScript error: /Users/arash1/Projects/brite-front-end/node_modules/@types/d3-chord/index.d.ts(38,56): Error TS1110: Type expected.
TypeScript error: /Users/arash1/Projects/brite-front-end/node_modules/@types/d3-chord/index.d.ts(39,25): Error TS1110: Type expected.
TypeScript error: /Users/arash1/Projects/brite-front-end/node_modules/@types/d3-chord/index.d.ts(41,59): Error TS1110: Type expected.

Can anyone offer some guidance as to how to use the new version or change the version of typescript?

@rapropos can you offer any guidance?