Registry / testing / hermes-eslint

hermes-eslint

JSON →
library0.35.0jsnpmunverified

A custom ESLint parser using the Hermes JavaScript parser, optimized for linting Flow-typed code. Version 0.35.0 is current, with active development on GitHub (facebook/hermes). Unlike babel-eslint or @babel/eslint-parser, hermes-eslint uses Hermes' own parser, ensuring precise adherence to Flow syntax and avoiding potential mismatches. It supports JSX, Flow, and modern ECMAScript features, with options for jsxPragma, jsxFragmentName, sourceType, and FBT. It is the recommended parser for Facebook's internal linting and for projects heavily reliant on Flow.

npm install hermes-eslint
INSTALL
IMPORT
SIG · HERMES-ESLINT
H
hermes-eslint
testingjavascriptv0.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.

default export (parser)
{ "parser": "hermes-eslint" }
{ "parser": require('hermes-eslint') }
In .eslintrc, specify the parser as a string, not a require call. hermes-eslint is used as an ESLint parser, not imported in code.
ParserOptions type
import type { ParserOptions } from 'hermes-eslint'
import { ParserOptions } from 'hermes-eslint'
ParserOptions is a type-only export; use import type or import {} from if not using runtime. Alternatively, use eslint's built-in types.
parseForESLint function
import { parseForESLint } from 'hermes-eslint'
const parseForESLint = require('hermes-eslint').parseForESLint;
ESM-only; requires module resolution. parseForESLint is used internally by ESLint, but can be called directly for custom integrations.

Configures ESLint to use hermes-eslint as parser with module source type and React JSX pragma.

// .eslintrc.json { "parser": "hermes-eslint", "parserOptions": { "sourceType": "module", "jsxPragma": "React" }, "rules": { "no-unused-vars": "error", "flowtype/no-types-missing-file-annotation": "off" } }
Debug
Known issues
breakingVersion 0.10.0 dropped support for ESLint < 6.
fix
Upgrade ESLint to 6.x or later and use hermes-eslint >=0.10.0.
affects: <0.10.0
deprecatedThe option 'useJSXTextNode' was removed in version 0.15.0.
fix
Remove 'useJSXTextNode' from parserOptions; it is no longer necessary.
affects: >=0.15.0
gotchaIf using Flow with hermes-eslint, ensure your ESLint config does not conflict with babel-eslint; both parsers may be active.
fix
Set 'parser' to 'hermes-eslint' only for .js/.jsx files; use override patterns if mixing with Babel.
affects: all
gotchaESLint's --fix may produce unexpected results with Flow type syntax; some rules may not support autofix.
fix
Test --fix on a small file first; disable autofix for rules known to conflict with Flow.
affects: all
deprecatedThe 'experimentalObjectRestSpread' option is no longer needed as of ECMAScript 2018.
fix
Remove the option; modern parsers support object rest/spread natively.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'hermes-eslint'
hermes-eslint not installed or ESLint cannot resolve the parser.
fix
Run 'npm install --save-dev hermes-eslint' or ensure it's in your package.json.
Error: Failed to load parser 'hermes-eslint' (from .eslintrc)
Incorrect JSON syntax in .eslintrc or parser name is not a string.
fix
Verify .eslintrc JSON is valid and that 'parser' is set to exactly "hermes-eslint".
TypeError: parseForESLint is not a function
Importing the module incorrectly in a CommonJS environment.
fix
Use dynamic import: const { parseForESLint } = await import('hermes-eslint'); or ensure you are in an ESM context.
Upgrade
Version history
0.35.0latest on npm
Audit
Dependencies
eslintrequiredPeer dependency; hermes-eslint is a custom parser that integrates with ESLint's parsing interface.
Agent activity
8 hits · last 30 days
node
8
Resources
hermes-eslint — npm install hermes-eslint · libregistry