You can use --tab-width prettier CLI option .
on:
pull_request:
push:
branches:
- master
- validation
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
- name: Prettify code
uses: creyD/[email protected]
with:
# This part is also where you can pass other options, for example:
prettier_options: --write **/*.{js,md} --tab-width 4
Please note that [email protected] is just executing prettier <prettier_options> command on the runner. So if you have more options to add you can specify it in the prettier_options(Should be separated by spaces)
Videos
» npm install prettier
Neovim and prettier is quite complicated story for me. Let's start that officially prettier recommends not to use prettier together with linter (https://prettier.io/docs/integrating-with-linters) and that makes everything more complicated (while eslint and prettier integration is quite OK, especially with eslint LSP). Now if want to use prettier separately official prettier page https://prettier.io/docs/vim offers either outdated options or the ones I don't want to use. null-ls was quite option until it was discontinued. Lastly I was using prettier via conform.nvim together with prettierd.
However I felt that there should be better way. Now I don't have time to implement that properly, but that's a task I could give to AI (opencode + sonnet 4.5). Here is result: prettier LSP https://github.com/daliusd/prettier-lsp . It works as fast as prettierd and does not need any extra plugins. Most probably it can be improved, but it is quite fun what you can do in 2 hours if all you have is idea.