ORY Prettier Styles
raw JSON → 1.3.0 verified Sat Apr 25 auth: no javascript
Shareable Prettier configuration used across all ORY projects, currently at v1.3.0 (2023). It enforces consistent code formatting via a single config reference or with custom overrides. Compared to creating your own Prettier config from scratch, this package provides a battle-tested set of defaults used by ORY's extensive open-source ecosystem, including specific rules for JSON, Markdown, and YAML. The package also includes a GitHub Action for automated format checking in CI/CD pipelines. Release cadence is ad-hoc; minor versions have introduced breaking changes to formatting defaults (e.g., restoring standard width for Markdown, switching to double quotes).
Common errors
error Cannot find module 'ory-prettier-styles' ↓
cause Package not installed or module resolution fails.
fix
Run 'npm install ory-prettier-styles --save-dev' or 'yarn add ory-prettier-styles -D'.
error Invalid configuration file: The exported value is not a function or object. ↓
cause Using module.exports = ory-prettier-styles instead of spreading.
fix
Use module.exports = { ...require('ory-prettier-styles'), /* overrides */ }.
Warnings
breaking v1.3.0 changed Markdown formatting width from a custom value back to Prettier's default (80). ↓
fix If you relied on the previous custom width, add 'printWidth: 80' or set a different value in your overrides.
breaking v1.3.0 uses default quote style (double quotes) instead of single quotes. ↓
fix If you prefer single quotes, override 'singleQuote: true' in your .prettierrc.js.
gotcha The GitHub Action @v1 tag points to the latest v1.x release, which may contain breaking changes in formatting defaults. ↓
fix Consider pinning to a specific version (e.g., @v1.2.0) to avoid unexpected formatting changes.
gotcha If you use the package.json 'prettier' key, you cannot override individual rules without switching to a configuration file. ↓
fix Use .prettierrc.js or similar to extend and override.
Install
npm install ory-prettier-styles yarn add ory-prettier-styles pnpm add ory-prettier-styles Imports
- package.json config wrong
No known common mistake.correct"prettier": "ory-prettier-styles" - require in .prettierrc.js wrong
module.exports = require('ory-prettier-styles')correctmodule.exports = { ...require('ory-prettier-styles'), // overrides } - GitHub Action wrong
uses: ory/prettier-styles@v1.3.0correctuses: ory/prettier-styles@v1
Quickstart
// In package.json:
{
"prettier": "ory-prettier-styles"
}
// Or in .prettierrc.js:
module.exports = {
...require('ory-prettier-styles'),
// singleQuote: true
}