S
Jun 02, 2024
3 min read

Prettier Plugin EdgeJS

Consistency and readability are hallmarks of great code. When working with the Edge templating language, part of the AdonisJS ecosystem, developers often struggled with the lack of a dedicated formatting tool. This gap led to the creation of the EdgeJS Prettier Plugin: a custom Prettier plugin designed to format .edge templates with ease.

What Is the EdgeJS Prettier Plugin?

The EdgeJS Prettier Plugin is an extension for Prettier, specifically designed to handle the syntax and structure of .edge templates. Edge templates are widely used in AdonisJS projects, but until now, there was no standardized way to format them. This plugin changes that, offering a seamless, automated solution for maintaining clean and consistent code.

With the EdgeJS Prettier Plugin, developers can:

  • Automatically format .edge templates.
  • Maintain consistency in large codebases.
  • Save time and effort by avoiding manual formatting.

Why Was the Plugin Created?

The EdgeJS Prettier Plugin was born out of necessity and a desire to give back to the open-source community. Here are the key reasons it was created:

  1. Community Need: AdonisJS lacked a formatter for Edge templates. While tools like Prettier support many languages, Edge templates had no official integration, leaving developers to rely on manual or inconsistent formatting practices.

  2. Giving Back: Open source thrives on collaboration and contribution. Building this plugin was a way to support the AdonisJS ecosystem by addressing a long-standing issue and providing a solution free for anyone to use.

  3. Default Formatter for AdonisJS Projects: The plugin has since been adopted as the default formatter for all AdonisJS projects using Edge templates, cementing its role as an essential tool in the community.

What Is It Built With?

The EdgeJS Prettier Plugin leverages cutting-edge technologies to deliver a high-quality developer experience:

  1. NodeJS
  2. TypeScript
  3. EdgeJS Parser

Community Reactions and Adoption

The reception to the EdgeJS Prettier Plugin has been overwhelmingly positive. Some highlights include:

  • Widespread Praise: Developers in the AdonisJS community have lauded the plugin for its seamless integration and the time it saves during development.

  • Adoption as Default: The plugin has been officially recognized as the default formatter for all AdonisJS projects using Edge templates. This milestone reflects its reliability and value to the community.

  • Open Source Contributions: The plugin has inspired others to contribute, extending its functionality and ensuring it evolves alongside the AdonisJS ecosystem.