dotansimha / dotansimha/graphql-code-generator

Allow running prettier/formatting before writing to disk

Open
#2,726 9 comments 18 reactions 0 assignees View on GitHub
core kind/enhancement
Dominant language
TypeScript
Stars
11.3k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
23

Description

**Is your feature request related to a problem? Please describe.**

After https://github.com/dotansimha/graphql-code-generator/releases/tag/v1.6.0, we've used a hook with `afterAllFileWrite: prettier --write`. The problem is that since this applies after files have been written to disk, all watchers are triggered even if the content is identical, then when that run is complete (riddled with lint errors that take a long time for webpack to render), the watcher is triggered again since the files have been formatted.

**Describe the solution you'd like**
A hook that runs before files are written to disk that allows us to format the content using the tool of our choice (e.g. prettier or eslint).

**Describe alternatives you've considered**
N/A

**Additional context**

N/A

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.