Skip to content
anchor

GitHub Action

Prettier CLI

v1.0.0 Latest version

Prettier CLI

anchor

Prettier CLI

🔨 Native Prettier CLI

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Prettier CLI

uses: hudsonm62/[email protected]

Learn more about this action in hudsonm62/prettier-cli

Choose a version

🔨 hudsonm62/prettier-cli

Checks status Dependabot status License Code style

🔥 Native, Fast statically linked prettier CLI for your favorite Shell, Docker and Github Actions. It allows you to run prettier CLI commands without having to install Node.js and any dependencies.

Note: This project is NOT affiliated with Prettier.

~Originally forked from actionsx/prettier.

Usage

  • path/to/prettier <args>

GitHub Actions

- uses: actions/checkout@v4
- uses: hudsonm62/prettier-cli@v1
  with:
    args: --check .
Input Default Description
args --check . Prettier CLI Arguments

Docker

All the provided Docker images can be used 'ad-hoc', this is especially handy in environments without a JavaScript interpreter.

The binary is located at /usr/local/bin/prettier (except for the bun- tags, which use a Bun.Build bundle).

USER WORKDIR CMD
guest /lint --check .

With docker run

docker run --rm -v path/to/repo:/lint hudsonm62/prettier-cli:latest

With a Dockerfile

FROM hudsonm62/prettier-cli:latest
WORKDIR /lint
COPY . .
CMD [ "--check", "." ]

Plugins

Plugins somewhat work! You'll typically have them available in node_modules on your cwd, or globally somewhere on $PATH. Please report any issues - this is still lacking in solid testing and could definitely be improved.

Tags

There are two versions of the Docker image available: "main" and "bun". The "main" tags provide the standard Prettier CLI, while the "bun" tags utilize the Bun runtime, which might be preferred in certain situations. Additionally, the "bun" images come in two distributions - Alpine and Debian:

Contributing

This project uses Bun. You'll either need to install it, or you can use the provided devcontainer.json.

See the Contributing Guidelines.

License

This project is licensed under the MIT License.