unic / unic/openapi-proptypes-generator
Use prettier to format the generated code
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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