Prettier EsJS Plugin
raw JSON → 0.1.0 verified Sat Apr 25 auth: no javascript
A Prettier plugin for formatting EsJS code, a Spanish-translated JavaScript dialect. Stable version 0.1.0. It integrates with Prettier 3.x as a plugin, leveraging Prettier's parsing and formatting pipeline. Key differentiator: enables Prettier to format .esjs files natively, supporting EsJS syntax such as keywords in Spanish. Currently in early development with basic formatting support.
Common errors
error Error: Cannot find module 'prettier-plugin-esjs' ↓
cause Plugin not installed or not in node_modules.
fix
Install the plugin: npm install -D prettier-plugin-esjs
error Error: [prettier] Couldn't resolve plugin for name "prettier-plugin-esjs" ↓
cause Prettier config file not properly configured or cached.
fix
Add the plugin to .prettierrc: { "plugins": ["prettier-plugin-esjs"] }
Warnings
gotcha Plugin requires Prettier v3; does not work with v2. ↓
fix Upgrade Prettier to ^3.0.0.
gotcha The plugin only formats EsJS files; standard .js or .ts files are unaffected. ↓
fix Ensure files have .esjs extension or configure Prettier overrides.
deprecated No deprecated features noted in current version. ↓
fix N/A
Install
npm install prettier-plugin-esjs yarn add prettier-plugin-esjs pnpm add prettier-plugin-esjs Imports
- default wrong
import prettierPluginEsjs from 'prettier-plugin-esjs'correctmodule.exports = { plugins: ['prettier-plugin-esjs'] }
Quickstart
// .prettierrc.js
module.exports = {
plugins: ['prettier-plugin-esjs'],
};
// Usage: npx prettier --write ./src/*.esjs