1.3.0 • Published 4 years ago
@whiite/prinit v1.3.0
Prinit - Prettier-init
A small CLI tool for quickly and easily creating prettier config files (prettierrc)
Install
npm install -g @whiite/prinitUsage
prinit- Creates aprettierrcJSON file using the saved configprinit use <file>- Sets a desiredprettierrcto be used as the default next timeprinitis run- File is saved to
$HOME/.prinit/user-config.json
- File is saved to
prinit default- Creates aprettierrcwith all defaultsprinit --json- Creates aprettierrcfile from the saved config in JSON format (the same as passing no argument)prinit --yaml- Creates aprettierrcfile from the saved config in YAML formatprinit --toml- Creates aprettierrcfile from the saved config in TOML format (the same as passing no argument)prinit --minimum- Creates aprettierrcfile from the saved config with default options excludedprinit --replace- Replaces all existingprettierrcfiles with the config created from a command
Example:
prinit default # Creates the default prettierrc
# Edit prettierrc file with your desired settings...
# Saves the found prettier config as the default
prinit use
# Alternatively specify the config file to use as the default
prinit use .prettierrc.json
# In a new project use:
prinit --minimum --yaml # Creates prettierrc using the saved file, default options excludedUsage notes:
- Specifying more than one format option (
--yaml,--json) will use the format with the highest priority:- Priority order: JSON > YAML > TOML.
- Specifying no format type will default to JSON
- If no file is specified with the
usecommand, the prettier file will be searched for starting in the current directory and looking upwards - If more than one
.prettierrcfile is found in a directory the file with the highest priority according to the order used by cosmiconfig