unic / unic/openapi-proptypes-generator

Use prettier to format the generated code

Open
#15 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2
Forks
2
Avg merge
1m
Merged PRs (30d)
1

Description

As pointed out in https://github.com/unic/openapi-proptypes-generator/pull/13/files#r369087261, we could get rid of all the logic to indent and instead use prettier to format the generated code. Something like:

generatedCode += `export const ${variableName} = ${JSON.stringify(object)}\n`
const options = await prettier.resolveConfig('.prettierrc')
const formattedCode = prettier.format(generatedCode, options)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the code that builds generatedCode and the repository's .prettierrc configuration. Compare the current indentation logic with the approach shown in pull request 13, then verify that generated output is formatted through Prettier and that existing generated content remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.