@swimlane/prettier-setup
v0.1.0
Published
A CLI tool for adding Prettier to projects.
Downloads
8
Maintainers
Readme
prettier-setup
A CLI tool for adding Prettier to projects.
Installation
- Install globally via npm:
npm install -g @swimlane/prettier-setup
Usage
In a terminal, navigate to a project's directory and run prettier-setup
.
This will prompt the user for the name of a Prettier configuration package to use (such as @swimlane/prettier-config-swimlane
) and a glob pattern of files to format with Prettier.
If no Prettier configuration package name is provided, the user will be guided through building one.
Note:
prettier-setup
assumes apackage.json
file exists in the same directory it's invoked in.
Output
- Creates a Prettier configuration file named
prettier.config.js
or.prettierrc
. - If a
.gitignore
file is found, creates a.prettierignore
file with the same contents as.gitignore
. - If a
.eslintrc
file is found, addseslint-config-prettier
as an extended configuration. - If a
tslint.json
file is found, addstslint-config-prettier
as an extended configuration. - Adds script
prettier
topackage.json
, which will format specified files when executed.
License
Credits
prettier-setup
is a Swimlane open-source project; we
believe in giving back to the open-source community by sharing some of the
projects we build.
Swimlane is an automated cyber security operations and incident response platform that enables cyber security teams to leverage threat intelligence, speed up incident response and automate security operations.