1.3.0 • Published 3 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/prinit
Usage
prinit
- Creates aprettierrc
JSON file using the saved configprinit use <file>
- Sets a desiredprettierrc
to be used as the default next timeprinit
is run- File is saved to
$HOME/.prinit/user-config.json
- File is saved to
prinit default
- Creates aprettierrc
with all defaultsprinit --json
- Creates aprettierrc
file from the saved config in JSON format (the same as passing no argument)prinit --yaml
- Creates aprettierrc
file from the saved config in YAML formatprinit --toml
- Creates aprettierrc
file from the saved config in TOML format (the same as passing no argument)prinit --minimum
- Creates aprettierrc
file from the saved config with default options excludedprinit --replace
- Replaces all existingprettierrc
files 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 excluded
Usage 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
use
command, the prettier file will be searched for starting in the current directory and looking upwards - If more than one
.prettierrc
file is found in a directory the file with the highest priority according to the order used by cosmiconfig