Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@prospective/pjas-prettier

Shared Prettier config for pjas-lead, pjas-frontend, and pjas-bannersandbox.

Usage

This package is published to GitHub Packages, so each consuming repo needs an .npmrc pointing the @prospective scope at that registry:

@prospective:registry=https://npm.pkg.github.com

Install the package in the dependecies, instead of devDependencies, so that you can use it in the CI as well. Otherwise, use --save-dev to omit it on production

npm install --save prettier @prospective/pjas-prettier

In package.json:

{
  "prettier": "@prospective/pjas-prettier"
}

No .prettierrc needed — Prettier resolves the config via the prettier field automatically.

Formatting

Each consuming repo should expose:

{
  "scripts": {
    "format": "prettier --write .",
    "format:check": "prettier --check ."
  }
}

Run npm run format:check before pushing. VS Code users get this automatically via each repo's committed .vscode/settings.json (Prettier extension esbenp.prettier-vscode as default formatter, format-on-save enabled).

Changing the config

Edit index.js and merge to master. The Publish workflow runs on every push to master and does the rest:

  1. Resolves the next patch number from the version already in the registry — nothing to bump by hand for a normal change.
  2. Publishes to GitHub Packages.
  3. Commits the bumped package.json back to master as Release vX.Y.Z, tags that commit vX.Y.Z, and opens a GitHub Release with autogenerated notes.

So every published version has a matching tag and Release, and git checkout v1.0.4 gets you exactly what was published.

For a breaking or feature-level release, bump the major or minor in package.json yourself; the workflow publishes that line starting at patch .0.

Afterwards, bump the version in each consuming repo's package.json and re-run prettier --write . there.

About

This project exports global prettier config for the projects in PJAS

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages