A Prettier plugin that integrates AutoCorrect to format copywriting in various file types, automatically adding spaces between CJK and Latin characters, correcting punctuation, and enforcing consistent whitespace. Version 0.4.3 requires Prettier 3.0.3+ and Node.js 14.18+ (LTS). Built on top of the autocorrect library, it aims to be a drop-in formatter but may not always match Prettier's format exactly. Ships TypeScript types. Developed by the un-ts team, part of a collection of Prettier plugins. Currently under active development with a focus on CJK text formatting.
npm install prettier-plugin-autocorrectVerified import paths — ran on the pinned version, not inferred.
Install the plugin as a dev dependency, add it to Prettier's plugin list in .prettierrc, and run Prettier to format Markdown files.
Update Prettier to version 3.0.3 or higher.
Review formatted output manually or disable plugin for specific files where needed.
Upgrade Node.js to v16 or later, as recommended by the package.
Ensure your file extensions are in the autocorrect list; otherwise, plugin may not apply.
Run 'npm install -D prettier prettier-plugin-autocorrect' or 'yarn add -D prettier prettier-plugin-autocorrect'.
Add '"plugins": ["prettier-plugin-autocorrect"]' to .prettierrc and ensure Prettier >=3.0.3.
Use 'const { AutocorrectPlugin } = require('prettier-plugin-autocorrect')' if available, or switch to ESM imports. Prefer adding to Prettier config instead of requiring directly.