skip to Main Content

In my Angular project, when I create new components, the files aren’t automatically formatted. I have to manually save each file to apply formatting. Is there a way to configure this so that the files are automatically formatted upon creation?

3

Answers


  1. There is an open feature request in the Angular CLI for this exact issue. However it’s not implemented yet, so for now you need to apply the format manually.

    Login or Signup to reply.
  2. If you create your files using the CLI. Then you can make use of Prettier CLI. For example you could set it up that it would always run after creating your file.

    Login or Signup to reply.
  3. Not seeing the utility of generating files and never modifying them, but if it’s an issue for you, "just" make Prettier run automatically on all added/modified files using a git hook.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search