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

Generate tsconfig #5519

Closed
wants to merge 3 commits into from
Closed

Conversation

ianschmitz
Copy link
Contributor

Closes #5508.

This PR automatically generates a tsconfig.json in the root of the project if it doesn't exist, when we determine that TypeScript is enabled on the project (when src/index.ts or src/index.tsx exists). We also validate the config to ensure that isolatedModules is set to true.

TODO:

  • Sort out what to do with loader.d.ts
  • Clean up project path reference when calling ts.parseJsonConfigFileContent()

@brunolemos brunolemos mentioned this pull request Oct 22, 2018
3 tasks
const paths = require('../../config/paths');

function verifyTypeScriptSetup() {
if (!fs.existsSync(paths.appTsConfig)) {
if (!paths.appIndexJs.endsWith('.ts') || !paths.appIndexJs.endsWith('.tsx')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be &&?

Also just fyi that the index file is not required to be .ts or .tsx on typescript projects.

@Timer
Copy link
Contributor

Timer commented Oct 22, 2018

Most of these changes already exist in one form or another on master, thanks!

@brunolemos
Copy link
Contributor

Thanks for your work @ianschmitz, I think you both worked on the same things almost together so this happened. That sucks but future contributions are still very welcome!

@Timer
Copy link
Contributor

Timer commented Oct 22, 2018

Yeah, GH was glitching out so no one could see ongoing contributions. 😅

@ianschmitz ianschmitz deleted the generate-tsconfig branch October 29, 2018 05:00
@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants