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

Documentation for usage with minimal TypeScript setup #464

Closed
Shinigami92 opened this issue Feb 10, 2022 · 3 comments · Fixed by #539
Closed

Documentation for usage with minimal TypeScript setup #464

Shinigami92 opened this issue Feb 10, 2022 · 3 comments · Fixed by #539
Assignees
Labels
c: docs Improvements or additions to documentation good first issue Good for newcomers needs documentation Documentations are needed p: 1-normal Nothing urgent

Comments

@Shinigami92
Copy link
Member

Shinigami92 commented Feb 10, 2022

Clear and concise description of the problem

Currently it's not clear for a TypeScript developer that they need to configure their tsconfig.json with the compilerOptions seen below.
We need to document that.

Suggested solution

// tsconfig.json
{
  "compilerOptions": {
    "esModuleInterop": true,
    "moduleResolution": "Node"
  }
}

Alternative

No response

Additional context

No response

@Shinigami92 Shinigami92 added s: pending triage Pending Triage needs documentation Documentations are needed and removed s: pending triage Pending Triage labels Feb 10, 2022
@Shinigami92 Shinigami92 moved this to Todo in Faker Roadmap Feb 10, 2022
@Shinigami92 Shinigami92 added the good first issue Good for newcomers label Feb 10, 2022
@ejcheng ejcheng added c: docs Improvements or additions to documentation p: 1-normal Nothing urgent labels Feb 10, 2022
@sprohaszka
Copy link
Contributor

Hi @Shinigami92,

Just to know how what to write, I've just launched a simple project with: typescript, jest and faker.
I started with project with a basic tsconfig.json file created when you run tsc --init.

The esModuleInterop is already set to true, but no moduleResolution option is set.
According to typescript documentation the default value is Classic.

I can do the modification on the README if you want, but are you sure about the last option?

@Shinigami92
Copy link
Member Author

I can do the modification on the README if you want, but are you sure about the last option?

No I'm not 100% sure, but think I have tested it and it did not work or at least did not use the esm version
Maybe something is fixed now after #520 🤔
But then it would take the cjs instead of esm, so maybe the moduleResolution is only valuable if you want to use esm, and I think you want

@sprohaszka
Copy link
Contributor

Ok :)
I pushed a PR. Let me know if it was what you had in mind.

@Shinigami92 Shinigami92 linked a pull request Feb 22, 2022 that will close this issue
@Shinigami92 Shinigami92 moved this from Todo to In Progress in Faker Roadmap Feb 22, 2022
Repository owner moved this from In Progress to Done in Faker Roadmap Feb 22, 2022
@ST-DDT ST-DDT removed this from Faker Roadmap Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: docs Improvements or additions to documentation good first issue Good for newcomers needs documentation Documentations are needed p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants