Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

noEmit does not apply #3

Open
unional opened this issue Feb 13, 2017 · 7 comments
Open

noEmit does not apply #3

unional opened this issue Feb 13, 2017 · 7 comments

Comments

@unional
Copy link
Contributor

unional commented Feb 13, 2017

We use typings to bundle the typings and using tsc to run test, so noEmit actually does not work.

What should we do for @types when redirect has landed?

Do we need to put typings into a single file or need to use /// <reference?

In either case, since we are writing d.ts, noEmit still doesn't apply. 🌷

@blakeembrey
Copy link
Contributor

We use typings to bundle the typings and using tsc to run test, so noEmit actually does not work.

In some places, you may use tsc to run the .ts tests (I do in a couple of places where I'm cheating and not using ts-node, just for checking compilation). Also avoids certain editors going compile-on-save crazy.

What should we do for @types when redirect has landed?

Still not sure, I was really, really hoping TypeScript would just adopt using package.json consistently here so we have to wait and find out.

Do we need to put typings into a single file or need to use /// <reference?

Should be the same as always, hopefully they'll pull the main out of package.json.

In either case, since we are writing d.ts, noEmit still doesn't apply.

Yeah, I realise. It's not there for the .d.ts files though, but for the .ts files people might use to write tests and whatnot.

@unional
Copy link
Contributor Author

unional commented Feb 13, 2017

For writing test, if noEmit, the test can't run, just compile though.

EDIT: Meaning, I have to have two versions of tsconfig.json. One for compile only, one for running tests.

Also avoids certain editors going compile-on-save crazy

Just turn it off in the tsconfig.json or in the IDE. 😛

@blakeembrey
Copy link
Contributor

For writing test, if noEmit, the test can't run, just compile though.

Yes, that's intentional. The guidelines are designed to use tsc directly (compile-time check) and then ts-node (runtime check) - there's no time you'd want to generate .js files from the .ts files, but you shouldn't need two tsconfig.json files (I only use one for everything).

@unional
Copy link
Contributor Author

unional commented Feb 13, 2017

I see, as you do (and the current generator-typings scaffold to) the ts-node route.
Recently my workflow does not use ts-node, so I do compile and run. 😄

@blakeembrey
Copy link
Contributor

@unional That makes sense. We could change it to do outDir and execute JavaScript tests instead, that's probably a better approach overall to move to eventually, but it's pretty similar (just no files generated instead).

@blakeembrey
Copy link
Contributor

I can keep this open until we update it (if we decide to?).

@unional
Copy link
Contributor Author

unional commented Feb 13, 2017

generator-typings@2 was always in my list. And I want to update it for @types. 😄

I'm not using ts-node for my own projects because I'm using ava, which run tests in parallel.
I couldn't find a way to make ts-node and ava work well together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants