piotrwitek / react-redux-typescript-jspm-starter

Futuristic, bundle-free, development environment for building Component-Driven SPA with React, Redux and TypeScript - powered by JSPM (SystemJS & Rollup with tree-shaking)
https://piotrwitek.github.io/react-redux-typescript-jspm-starter/
MIT License
231 stars 43 forks source link

tsc errors #13

Closed deivers closed 8 years ago

deivers commented 8 years ago

Nice starter kit! I've been looking for something like this for a long time. It looks like it has all the pieces I want, and even a plan to add D3 (version 4, I hope!)

When I clone and do npm install then npm start, it seems to work, but I see the following in my ts compiler console (WebStorm): Error:Error: Parse tsconfig error [{"messageText":"Unknown compiler option 'noImplicitThis'.","category":1,"code":5023},{"messageText":"Unknown compiler option 'noUnusedLocals'.","category":1,"code":5023},{"messageText":"Unknown compiler option 'noUnusedParameters'.","category":1,"code":5023},{"messageText":"Unknown compiler option 'typeRoots'.","category":1,"code":5023},{"messageText":"Unknown compiler option 'lib'.","category":1,"code":5023},{"messageText":"Unknown compiler option 'strictNullChecks'.","category":1,"code":5023}]

I've confirmed that WebStorm is using the locally installed typescript. Am I missing something?

piotrwitek commented 8 years ago

Hi @deivers, Thanks, I'm glad that you like it :) Regarding D3 it'll definitely be an edge version, I'm also in the middle of adding a solid setup of Redux with React Router from my other project which should be finished this weekend.

Errors that you see are produced because the properties are the new features from TS v2.0 and WebStorm IDE uses it's own baked-in TS version, which is an older one thus not recognizing them. You can of course simply delete them without any drawbacks, you'll just miss some recently added features in latest TS 2.0/2.1, but that's not a big deal.

If you'll like to benefit from newest features of TS you would need to use Atom or VS Code editor because they use latest TS language services, and for now I would really suggest to going with Atom which at the time have the best support and this starter kit is set-up to work best with it.

It's also worth to note that VS Code can use any typescript language version by using typescript.tsdk setting and the best approach from my experience is to use local TS per project for editor Intellisense, as this will give you an insight that the features you are using in your code are in fact compatible with currently used TS compiler version. Currently, you can only do it in VS Code, Compared to Atom, VS Code is more feature-full and much more performant but lack in an ecosystem so I'm waiting for VS Code to mature a bit more.

There is also a new alternative from a creator of Atom TS Extension which I didn't have time to play with yet but looks very promising: http://alm.tools/

piotrwitek commented 8 years ago

@deivers this issues are resolved and should be merged later today Right now compilation should work also using npm run tsc or just tsc -p src cli command, or if your ide is using local npm typescript installation acknowledgement to @jonaskello for his contribution

ShiiRochi commented 7 years ago

If the matter is a compiler then as far as I know, you can specify custom TypeScript compiler in WebStorm.

Settings => Languages & Frameworks => TypeScript.

In the right window of settings: right to TypeScript Version click on Edit and now just specify the path route to...for example...directory where typescript was installed with npm install -g typescript and then to its lib subdirectory. For example:

...\npm\node_modules\typescript\lib