ember-cli-typescript
ember-cli-typescript copied to clipboard
Why do we default to `allowJs: true`?
Why do we need
allowJs? I've had issues with TS errors being ignored until publish time (and breaking publishing automation) becauseallowJsis explicitly set tofalsebyts:precompileherehttps://github.com/typed-ember/ember-cli-typescript/blob/v3.1.3/ts/lib/commands/precompile.ts#L31
_Originally posted by @rwjblue in https://github.com/render_node/MDIzOlB1bGxSZXF1ZXN0UmV2aWV3VGhyZWFkMjY0OTQzOTgzOnYy/pull_request_review_threads/discussion
(I plan to dig into this next week; I just wanted to leave this here so I don't forget!)
For reference, the case where the failure only happened upon running ts:precompile was over in @ember/test-helpers.
Over there we run tsc --noEmit in CI (along with other linting commands) to attempt to ensure that we don't introduce TypeScript issues for each pull request.
The issue was introduced in https://github.com/emberjs/ember-test-helpers/pull/819. CI passed there (including a tsc -p tsconfig.json --noEmit) as you can see here. However, when I attempted to publish the next version I got an error from ember ts:precompile which was essentially an issue saying that requirejs was not a thing (it was used here). I fixed it over in https://github.com/emberjs/ember-test-helpers/pull/849.
I hit this last week in an engine for work where, being new to the codebase, I didn't realize allowJs: true was set and it didn't bite me until publish time. I'm in favor of allowJs: false by default.
I'd love to revisit our whole default tsconfig.json prior to the 4.0 release if we can.
We've revisited our tsconfig.json and its source of truth also now lives at @tsconfig/ember. 🎉