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

Update tsconfig and corresponding docs #1488

Merged
merged 6 commits into from
Mar 3, 2022
Merged

Update tsconfig and corresponding docs #1488

merged 6 commits into from
Mar 3, 2022

Conversation

chriskrycho
Copy link
Member

Our generated blueprint was years out of date, and between the changes we made in the types over the last year or so and the guidance we have given in the TS RFCs we are now both able and required to set strict: true as well as to opt into noUncheckedIndexedAccess and to disable allowSyntheticDefaultImports and esModuleInterop.

Additionally, this provided a nice opportunity to document the choices we have made so folks have something to latch onto when looking at the config we generate for them, and to update the config to target the current latest versions of the target and module fields.

Our generated blueprint was *years* out of date, and between the
changes we made in the types over the last year or so and the guidance
we have given in the TS RFCs we are now both *able* and *required* to
set `strict: true` as well as to opt into `noUncheckedIndexedAccess`
and to disable `allowSyntheticDefaultImports` and `esModuleInterop`.

Additionally, this provided a nice opportunity to document the choices
we have made so folks have something to latch onto when looking at the
config we generate for them, and to update the config to target the
current latest versions of the `target` and `module` fields.
Copy link
Collaborator

@NullVoxPopuli NullVoxPopuli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding all the context/comments! <3

Copy link
Member

@dfreeman dfreeman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Thank you!

Comment on lines +56 to 59
"declaration": true,
"declarationMap": true,
"inlineSourceMap": true,
"inlineSources": true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we set noEmit: true here and use Babel for actually emitting code, do these flags have any effect?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't actually know! These are what I added four years ago. 😬

"target": "es2020",
"allowJs": true,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "node",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not actionable yet, but I suspect we're going to want to change this to node12 as soon as that graduates from nightly, since Webpack 5 (and so by extension, ember-auto-import and Embroider) honor exports config.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Hoping they ship that in 4.7 and we can flip it on. 🤞🏼

@chriskrycho chriskrycho merged commit ad1e4ee into master Mar 3, 2022
@chriskrycho chriskrycho deleted the update-tsconfig branch March 3, 2022 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants