GitHub Action
Prettier CLI
🔥 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
.
path/to/prettier <args>
- uses: actions/checkout@v4
- uses: hudsonm62/prettier-cli@v1
with:
args: --check .
Input | Default | Description |
---|---|---|
args |
--check . |
Prettier CLI Arguments |
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 . |
docker run --rm -v path/to/repo:/lint hudsonm62/prettier-cli:latest
FROM hudsonm62/prettier-cli:latest
WORKDIR /lint
COPY . .
CMD [ "--check", "." ]
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.
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:
-
Main Binary Tags:
-
Bun Bundle Tags:
This project uses Bun. You'll either need to install it, or you can use the provided devcontainer.json
.
See the Contributing Guidelines.
This project is licensed under the MIT License.