Prettier Config VuePress

raw JSON →
7.1.0 verified Sat Apr 25 auth: no javascript

Prettier configuration used by the VuePress Team internally. Current stable version is 7.1.0, with recent major version 8.0.0 migrating to @vuepress scope. This package is not intended for external use unless you are familiar with its specific settings. It is published on npm and includes TypeScript type definitions.

error Error [ERR_REQUIRE_ESM]: require() of ES Module not supported.
cause Using require() on ESM-only package with Node <20 or without { type: 'module' }.
fix
Use import statement or upgrade Node to 20+ with { type: 'module' }.
error Cannot find module 'prettier-config-vuepress'
cause Package not installed or not in node_modules.
fix
Run: npm install -D prettier-config-vuepress
error Invalid configuration for prettier: Expected object, got string
cause Setting prettier config to a string without proper resolution.
fix
In package.json, set 'prettier': 'prettier-config-vuepress' or use .prettierrc.js that exports the config object.
breaking Since v8.0.0, the package has been migrated to @vuepress scope. The old package name 'prettier-config-vuepress' may no longer be updated.
fix Use '@vuepress/prettier-config' instead.
gotcha This config is for internal VuePress team use. Using it in your own project may cause unexpected formatting.
fix Prefer standard Prettier configs or create your own.
deprecated The package does not follow semver strictly; minor releases may contain breaking changes.
fix Pin to exact version.
gotcha Requires Node >= 20. Older Node versions will fail to import.
fix Upgrade Node to 20+ or use an older version of the package.
npm install prettier-config-vuepress
yarn add prettier-config-vuepress
pnpm add prettier-config-vuepress

Shows how to use the package via package.json or .prettierrc.js

// Install: npm install -D prettier prettier-config-vuepress
// In package.json:
{
  "prettier": "prettier-config-vuepress"
}
// Or in .prettierrc.js:
const config = require('prettier-config-vuepress');
module.exports = config;