prettier-max
raw JSON → 1.16.0 verified Sat Apr 25 auth: no javascript
Minimalist Vite plugin that auto-formats code with Prettier and optionally runs TypeScript type checking on build, including deprecation and default import detection. Current stable version: 1.16.0. Release cadence: active, with regular updates. Key differentiators: no ESLint configuration, relies on .prettierrc and tsconfig.json for consistency, simple API, and fail-on-error behavior by default. Requires peer dependencies: prettier >=3.6.0, typescript >=5.0.0 <7.0.0, vite >=5.0.0. Ships TypeScript types.
Common errors
error Error: Cannot find module 'prettier' ↓
cause Missing peer dependency 'prettier'.
fix
npm install -D prettier
error Error: The plugin 'prettier-max' requires a Vite version >=5.0.0 ↓
cause Vite version is too old.
fix
Upgrade vite to >=5.0.0
error Error: The plugin 'prettier-max' requires a TypeScript version >=5.0.0 and <7.0.0 ↓
cause TypeScript version is out of range.
fix
Install matching TypeScript version (>=5.0.0 <7.0.0)
error TypeError: prettierMax is not a function ↓
cause Incorrect import syntax (e.g., using named import instead of default).
fix
Use
import prettierMax from 'prettier-max' Warnings
gotcha Plugin requires Vite >=5.0.0, Prettier >=3.6.0, and TypeScript >=5.0.0 <7.0.0. Using older versions may cause runtime errors. ↓
fix Upgrade to supported versions: vite@^5, prettier@^3.6, typescript@^5.0.
gotcha TypeScript validation runs only if TypeScript is installed. If not, validation is silently skipped and a warning is logged. ↓
fix Install TypeScript or disable with the `typescript: false` option.
gotcha By default, `failOnError` is true, meaning any formatting or type error stops the build. Set to false to continue on errors. ↓
fix Use `prettierMax({ failOnError: false })`.
breaking Breaking change in v1.16.0: The plugin is now ESM-only. CommonJS require() no longer works. ↓
fix Use `import` syntax instead of `require()`. If you must use CJS, stick to v1.15.x.
Install
npm install prettier-max yarn add prettier-max pnpm add prettier-max Imports
- prettierMax wrong
const prettierMax = require('prettier-max')correctimport prettierMax from 'prettier-max' - PluginOptions
import type { PluginOptions } from 'prettier-max' - PrettierMaxPlugin wrong
import { PrettierMaxPlugin } from 'prettier-max'correctimport type { PrettierMaxPlugin } from 'prettier-max'
Quickstart
import { defineConfig } from 'vite';
import prettierMax from 'prettier-max';
export default defineConfig({
plugins: [
prettierMax()
]
});