prettier-esextend
v1.362.0
Published
Prettier ESExtend - Create custom Prettier plugins with JavaScript extensions.
Maintainers
Readme
Prettier ESExtend
Create custom Prettier plugins with JavaScript extensions.
What does it do?
Combines multiple Prettier plugins, extends the Acorn parser, and adds automatic fallbacks for printers.
Installation
npm install prettier-esextendQuick Start
import { esextend } from "prettier-esextend";
const myPlugin = esextend({
languages: [
{
name: "JavaScript Extended",
parsers: ["custom-parser"],
},
],
parsers: {
"custom-parser": {
acornPlugin: (BaseParser) =>
class extends BaseParser {
/* your logic */
},
},
astFormat: "custom-estree",
// other methods use automatic fallback
},
printers: {
"custom-estree": {
print: (path, options, print) => {
/* your logic */
},
// other methods use automatic fallback
},
},
});Combine Plugins
const plugin = esextend([plugin1, plugin2, plugin3]);Features
- ✅ Multiple plugin composition
- ✅ Acorn parser extension
- ✅ Automatic estree fallback
- ✅ Full TypeScript support
License
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ by Italo Almeida. Contributions are welcome!
⭐ If this project helped you, please give it a star!
