Command line tool compare Prettier output for an entire project
npm install prettier-compare-clibash
npm install prettier-compare-cli --global
Or if using Yarn:
yarn global add prettier-compare-cli
`
The following applications must be available on the path:
- Prettier
- Meld (if the difftool argument isn't provided)
Example usage
Run the comparison using a specific configuration:
`bash
prettier-compare --src /Git/my-project --config /Git/my-project/prettier.config.js
`
Not passing the config argument will call Prettier with the no-config
option.
`bash
prettier-compare --src /Git/my-project
`
Specify that Prettier should only be called on js and jsx files.
`bash
prettier-compare --src /Git/my-project --extensions js,jsx
`
Command line arguments
Argument | Description
---------- | ----------------------------------------------
src | Path to source directory
config | Path to the Prettier config file (optional)
extensions | Comma separated list of extensions (optional)
difftool | The directory diff command (optional)
Any program where the pattern $difftool $directoryA $directoryB` will open a