It will be good if the guide mentions a way to format specified files only. This can be done in two ways:
npx --write <pattern to match required files>: npx is a package which comes with npm. It simply executes node packages if found in ./node_modules. If this doesn't work you may install it using sudo npm install -g npx otherwise follow the other method../node_modules/prettier/bin-prettier.js --write <pattern to match required files>: This command runs prettier installed in the node_modules.pattern to match required files examples:
src/Diagram/index.jsstatic/docs/command-reference/add.mdstatic/docs/**/*.mdI guess this info would go in the contributing documentation guide. I vote for npx.
p.s. I often git add my changes and then use git diff --staged --name-only | xargs npx prettier --write to lint only the staged files. But that shouldn't be necessary anymore now that we have automatic pretty-quick (kudos @algomaster99 in #386)
We have added a mention already how to run it for a single Markdown file. Do we need anything else here? Add a command for JS?
@shcheklein It's the same. You just need to write js files in <files> instead of md files.
ok, closing it then. Feel free to reopen it if you feel we are missing something here.
Most helpful comment
I guess this info would go in the contributing documentation guide. I vote for
npx.p.s. I often
git addmy changes and then usegit diff --staged --name-only | xargs npx prettier --writeto lint only the staged files. But that shouldn't be necessary anymore now that we have automaticpretty-quick(kudos @algomaster99 in #386)