Skip to content

fellowapp/pre-commit-prettier

 
 

Repository files navigation

prettier mirror

Mirror of prettier package for pre-commit. Adjusted to work with prettier version 3 and above.

For pre-commit: see https://github.com/pre-commit/pre-commit

For prettier: see https://github.com/prettier/prettier

Using prettier with pre-commit

Add this to your .pre-commit-config.yaml:

- repo: https://github.com/JoC0de/pre-commit-prettier
  rev: "" # Use the sha / tag you want to point at
  hooks:
    - id: prettier

When using prettier plugins you'll need to declare them under additional_dependencies. When the plugin name doesn't start with @prettier/ you need to also add a --plugin= argument. For example:

- repo: https://github.com/JoC0de/pre-commit-prettier
  rev: "" # Use the sha / tag you want to point at
  hooks:
    - id: prettier
      additional_dependencies:
        - [email protected]
        - "@prettier/[email protected]"
        - "[email protected]"
      args:
        - --plugin=prettier-plugin-ini

By default, all files are passed to prettier, if you want to limit the file list, adjust types / types_or / files:

- id: prettier
  types_or: [css, javascript]

About

mirror of the `prettier` npm package for pre-commit

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PowerShell 69.5%
  • JavaScript 30.5%