prettier-max
v1.13.0
Published
Minimalist automatic Prettier formatting plugin for Vite
Maintainers
Readme
prettier-max
Minimalist automatic Prettier formatting plugin for Vite

What is this?
prettier-max is a very simple Vite plugin that automatically formats your code with Prettier during the build process. It also includes TypeScript validation to ensure your code is type-safe before building.
ESLint is complex and often throws its own configuration errors. For those who find basic auto-formatting and TypeScript type checking sufficient, this simple plugin may be useful.
Key features:
- Automatic Prettier formatting on build start
- When using TypeScript, post-formatting TypeScript type checking. Additionally, JSDoc deprecation (
@deprecated) can also be checked. - All fine-tuning is specified in
.prettierrcandtsconfig.json, ensuring high consistency - This is not doing anything unnecessary
Installation
Install in devDepencencies:
npm install -D prettier-maxAdd the plugin to your vite.config.ts:
import { defineConfig } from 'vite';
import prettierMax from 'prettier-max';
export default defineConfig({
plugins: [
prettierMax(), // Use default settings
],
});If the default behavior is fine, you're all set!
The build works as follows:
- On build start, the plugin formats all target files
- If formatting succeeds and TypeScript is enabled (by default), it runs type checking and detecting deprecation
- Errors are reported to the console with file paths and line numbers
- If
failOnErroristrue(by default), the build stops on any errors
TypeScript availability
- TypeScript validation runs only when TypeScript is available in your project.
- If TypeScript is not installed, the validation step is skipped and a warning is logged.
- You can also explicitly disable it with the
typescript: falseoption. - Provide a string path (relative to your project root) to use a specific
tsconfig.json, or an array of paths to validate multiple configs.
Other features, see repository document.
License
Under MIT.
