ember-cli-typescript icon indicating copy to clipboard operation
ember-cli-typescript copied to clipboard

Why do we default to `allowJs: true`?

Open chriskrycho opened this issue 5 years ago • 3 comments
trafficstars

Why do we need allowJs? I've had issues with TS errors being ignored until publish time (and breaking publishing automation) because allowJs is explicitly set to false by ts:precompile here

https://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!)

chriskrycho avatar May 15 '20 02:05 chriskrycho

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.

rwjblue avatar May 15 '20 02:05 rwjblue

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.

jamescdavis avatar May 28 '20 16:05 jamescdavis

I'd love to revisit our whole default tsconfig.json prior to the 4.0 release if we can.

dfreeman avatar Jul 01 '20 13:07 dfreeman

We've revisited our tsconfig.json and its source of truth also now lives at @tsconfig/ember. 🎉

chriskrycho avatar Sep 28 '23 23:09 chriskrycho