Shared Prettier config for pjas-lead, pjas-frontend, and pjas-bannersandbox.
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.comInstall 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-prettierIn package.json:
{
"prettier": "@prospective/pjas-prettier"
}No .prettierrc needed — Prettier resolves the config via the prettier field automatically.
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).
Edit index.js and merge to master. The Publish workflow runs on every push to master and does the rest:
- Resolves the next patch number from the version already in the registry — nothing to bump by hand for a normal change.
- Publishes to GitHub Packages.
- Commits the bumped
package.jsonback tomasterasRelease vX.Y.Z, tags that commitvX.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.