Reputation: 3752
Currently I'm using Ionic 2.0.0-beta.37. Which uses typescript 1.8.x . I'm attempting to us D3 version 4 with typescript, but the typings from d3-v4-definitelytyped use Typescript 2.x. I'm getting compile errors on the typings and after putting in an issue on the d3-v4-definitelytyped repo, I learned that I need to use TS 2.x in my Ionic 2 project.
This is the error that I'm getting:
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.
I looked at my package.json
file in my main IONIC directory and I don't see a typescript
as a dependency, so I figure that it is using something else to define the version. I see:
So i went into tslint-ionic-rules
and saw:
"devDependencies": {
"typescript": "^1.8.10"
}
Just to make an attempt I ran npm install typescript@rc
to install the new version in tslint-ionic-rules
node_modules
to see if I get the same error. The error is still there.
Can some one offer guidance on how to do so? The RC was announced on the MFST Blog recently.
Upvotes: 5
Views: 436
Reputation: 1
Before I start, I didn't exactly solve the problem yet but I can at least explain what I've tried. To be exact I didn't use lint in my gulp.file but I did notice that ionic2 used browserify and when you look at the ionic-gulp-browserify-typescript module, you can see:
tsifyOptions: {}
You can use this to set the version of TS you'd like to use.
Example:
It should look something like this:
gulp.task('build', ['clean'], function(done){
runSequence(
['sass', 'html', 'fonts', 'scripts'],
function(){
buildBrowserify({
minify: isRelease,
browserifyOptions: {
debug: !isRelease
},
uglifyOptions: {
mangle: false
},
tsifyOptions: {
typescript: require('your typescript')
}
}).on('end', done);
}
);
});
Upvotes: 0