@weandthem/prettier-config
v0.0.45
Published
Shared Prettier config for We and Them projects
Downloads
11
Readme
Prettier Config
This repo serves as the shared Prettier config for We and Them projects.
Table of contents
Using this package
Install this package and its peer dependencies as dev dependencies in your project:
$ npm i -D prettier @weandthem/prettier-config
Specify it in your
package.json
"prettier": "@weandthem/prettier-config"
Developing
Setup
Clone this repo
$ git clone https://github.com/WeAndThem/prettier-config.git
Enter the cloned directory
$ cd prettier-config
Install dependencies
$ npm install
VS Code is recommended because this repo includes environmental settings that help create a consistent development environment across engineers. Upon opening this repo in VS Code, you'll be prompted to install recommended extensions.
File Structure
.github/workflows/
GitHub Actions configs.vscode/
Shared VS Code configscripts/
Shell scripts used with Husky git hooks.prettierrc.js
Prettier config for this repo imports from index.jsindex.js
Shared Prettier configuration
Development flow
Do not work on
master
! Create local branches off ofmaster
. We have git hooks configured to prevent committing or pushing tomaster
. Forking is disabled for this repo.Keep commits small and commit messages relevant. Prepend the Jira ticket number to at least one of your commits for reporting.
Example:
HAR-28: enforce singleQuote setting
pre-commit and pre-push hooks should help maintain consistent code styles, but can also be run manually as necessary:
$ npm run prettify
Test changes locally against another We and Them project by linking this module globally:
$ npm link
Then, in another We and Them project that consumes this config:
$ npm link @weandthem/prettier-config
Changes made in this project are immediately reflected in the other project until the link is broken.
Bump the project version in
package.json
Run
npm install
to update the version inpackage-lock.json
Commit
package.json
andpackage-lock.json
in an isolated commit with the following convention:$ git commit -m 'Release 0.0.6'
The GitHub action that publishes the package will read this commit and tag the release appropriately.
Open pull requests against
master
and select an assignee to review the changes.The assignee leaves any necessary comments and selects either "approve" or "reject" on GitHub.
Once the PR is approved, the author performs the merge.
A GitHub Action will publish the package automatically.
Projects consuming this config will need to run
npm update
to receive the changes.