keithamus / sort-package-json

Sort an Object or package.json based on the well-known package.json keys
MIT License
790 stars 83 forks source link

Create .pre-commit-hooks.yaml for support pre-commit hook #319

Closed jellydn closed 4 months ago

jellydn commented 4 months ago

What

Support https://pre-commit.com/

How

Refer https://pre-commit.com/index.html#developing-hooks-interactively

Usage:

repos:
  - repo: https://github.com/jellydn/sort-package-json
    rev: "1686d9d2ddfb065c4514c637ee4b9985dfbf01dd" # Use the sha / tag you want to point at
    hooks:
      - id: sort-package-json

  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: "v4.0.0-alpha.8" # Use the sha or tag you want to point at
    hooks:
      - id: prettier
        # Those are not supported by biomejs yet, refer https://biomejs.dev/internals/language-support/
        types_or: [html, css, markdown]
  - repo: https://github.com/biomejs/pre-commit
    rev: "v0.1.0" # Use the sha / tag you want to point at
    hooks:
      - id: biome-check
        exclude: "package.json"
        additional_dependencies: ["@biomejs/biome@1.7.1"]

Tested on my PR https://github.com/jellydn/next-app-starter/pull/1606/files

keithamus commented 4 months ago

Thanks but I don't think this is necessary.