Registry / devops / prettier-plugin-hermes-parser

prettier-plugin-hermes-parser

JSON →
library0.35.0jsnpmunverified

prettier-plugin-hermes-parser provides a Prettier plugin that integrates the Hermes JavaScript parser for code formatting. Currently at version 0.35.0, this package is explicitly designed for users who require 'bleeding edge' access to the very latest features and updates from the Hermes parser within their Prettier workflow. For general, stable project use, the official `@prettier/plugin-hermes` is the recommended and more widely supported alternative, offering a more robust integration path. The release cadence of this specific plugin is typically tied directly to updates in the Hermes parser itself, which may result in less frequent or less predictable releases compared to mainstream Prettier plugins. Its primary differentiator is its direct, early adoption of Hermes parsing capabilities, making it suitable for experimenting with new language features or advanced use cases that specifically target the Hermes engine.

npm install prettier-plugin-hermes-parser
INSTALL
IMPORT
SIG · PRETTIER-PLUGIN-HE
P
prettier-plugin-hermes-parser
devopsjavascriptv0.35.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

"prettier-plugin-hermes-parser"
// .prettierrc { "plugins": ["prettier-plugin-hermes-parser"] }
// .prettierrc (Incorrect, expects string reference in JSON/YAML) { "plugins": [require('prettier-plugin-hermes-parser')] }
When configuring Prettier via JSON or YAML files (e.g., `.prettierrc`), plugins are referenced by their npm package name as a string.
"hermes"
// .prettierrc { "overrides": [ { "files": "*.js", "options": { "parser": "hermes" } } ] }
// .prettierrc (Incorrect, 'parser' expects the parser name, not the plugin package name) { "parser": "prettier-plugin-hermes-parser" }
The `parser` option within Prettier configuration should specify 'hermes' to activate the parser provided by this plugin for target files.
plugin module
// prettier.config.js (CommonJS) module.exports = { plugins: [require('prettier-plugin-hermes-parser')], overrides: [ { files: ['*.js', '*.jsx'], options: { parser: 'hermes' } } ] };
// prettier.config.js (Incorrect, usually resolved by string but direct require is explicit) module.exports = { plugins: ['prettier-plugin-hermes-parser'], // ... };
For JavaScript or TypeScript Prettier configuration files (e.g., `prettier.config.js`, `prettier.config.mjs`), plugins can be directly `require()`d or `import`ed as module objects.

This configuration snippet for `.prettierrc` loads the Hermes parser plugin and then instructs Prettier to use the 'hermes' parser for `.js`, `.jsx`, and `.flow` files.

{ "plugins": ["prettier-plugin-hermes-parser"], "overrides": [ { "files": [".js", ".jsx", ".flow"], "options": { "parser": "hermes" } } ] }
Debug
Known issues
gotchaThis plugin is intended for 'bleeding edge' use. For most stable projects, the official `@prettier/plugin-hermes` is the recommended and more robust alternative. Consider your project's stability requirements before choosing this plugin.
fix
For stable projects, install and configure `@prettier/plugin-hermes` instead of `prettier-plugin-hermes-parser`.
affects: >=0.1.0
breakingThis plugin has a peer dependency on Prettier v3.0.0 or higher. Using it with Prettier v2.x or earlier will lead to installation issues or runtime errors.
fix
Upgrade your Prettier installation to version 3.0.0 or higher: `npm install prettier@latest` or `yarn add prettier@latest`.
affects: <3.0.0 of prettier
gotchaDue to its 'bleeding edge' nature and direct ties to the Hermes parser development, this plugin might introduce more frequent or less documented breaking changes compared to more stable Prettier plugins. API stability is not guaranteed.
fix
Thoroughly test your formatting setup after any plugin update. Pin the plugin version in `package.json` to prevent unexpected updates: `npm install prettier-plugin-hermes-parser@0.35.0`.
affects: >=0.1.0
Errors
Common errors & fixes
Error: [prettier]: Unknown parser 'hermes'.
The 'hermes' parser could not be found because the plugin was not loaded, or the parser option was misspelled.
fix
Ensure `prettier-plugin-hermes-parser` is listed in your `plugins` array in your Prettier config (e.g., `plugins: ['prettier-plugin-hermes-parser']`) and that the `parser` option is set to `'hermes'` for the relevant files.
Error: [prettier]: Plugin `prettier-plugin-hermes-parser` not found.
The plugin package is either not installed or not resolvable by Prettier.
fix
Run `npm install prettier-plugin-hermes-parser` or `yarn add prettier-plugin-hermes-parser`. Verify that it's correctly listed in your `package.json` and that your Prettier config accurately references its name.
TypeError: The 'plugins' option must be an array of strings or plugin objects.
Incorrect type passed to the `plugins` array in a Prettier configuration file.
fix
If using a JSON/YAML `.prettierrc` file, use string names: `"plugins": ["prettier-plugin-hermes-parser"]`. If using a `prettier.config.js` file, `require()` the module: `plugins: [require('prettier-plugin-hermes-parser')]`.
Upgrade
Version history
0.35.0latest on npm
Audit
Dependencies
prettierrequiredThis is a Prettier plugin and requires Prettier to function.
Agent activity
4 hits · last 30 days
node
4
Resources
prettier-plugin-hermes-parser — npm install prettier-plugin-hermes-parser · libregistry