{"id":18414,"library":"hermes-eslint","title":"hermes-eslint","description":"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.","status":"active","version":"0.35.0","language":"javascript","source_language":"en","source_url":"git@github.com:facebook/hermes","tags":["javascript"],"install":[{"cmd":"npm install hermes-eslint","lang":"bash","label":"npm"},{"cmd":"yarn add hermes-eslint","lang":"bash","label":"yarn"},{"cmd":"pnpm add hermes-eslint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; hermes-eslint is a custom parser that integrates with ESLint's parsing interface.","package":"eslint","optional":false}],"imports":[{"note":"In .eslintrc, specify the parser as a string, not a require call. hermes-eslint is used as an ESLint parser, not imported in code.","wrong":"{\n  \"parser\": require('hermes-eslint')\n}","symbol":"default export (parser)","correct":"{\n  \"parser\": \"hermes-eslint\"\n}"},{"note":"ParserOptions is a type-only export; use import type or import {} from if not using runtime. Alternatively, use eslint's built-in types.","wrong":"import { ParserOptions } from 'hermes-eslint'","symbol":"ParserOptions type","correct":"import type { ParserOptions } from 'hermes-eslint'"},{"note":"ESM-only; requires module resolution. parseForESLint is used internally by ESLint, but can be called directly for custom integrations.","wrong":"const parseForESLint = require('hermes-eslint').parseForESLint;","symbol":"parseForESLint function","correct":"import { parseForESLint } from 'hermes-eslint'"}],"quickstart":{"code":"// .eslintrc.json\n{\n  \"parser\": \"hermes-eslint\",\n  \"parserOptions\": {\n    \"sourceType\": \"module\",\n    \"jsxPragma\": \"React\"\n  },\n  \"rules\": {\n    \"no-unused-vars\": \"error\",\n    \"flowtype/no-types-missing-file-annotation\": \"off\"\n  }\n}","lang":"typescript","description":"Configures ESLint to use hermes-eslint as parser with module source type and React JSX pragma."},"warnings":[{"fix":"Upgrade ESLint to 6.x or later and use hermes-eslint >=0.10.0.","message":"Version 0.10.0 dropped support for ESLint < 6.","severity":"breaking","affected_versions":"<0.10.0"},{"fix":"Remove 'useJSXTextNode' from parserOptions; it is no longer necessary.","message":"The option 'useJSXTextNode' was removed in version 0.15.0.","severity":"deprecated","affected_versions":">=0.15.0"},{"fix":"Set 'parser' to 'hermes-eslint' only for .js/.jsx files; use override patterns if mixing with Babel.","message":"If using Flow with hermes-eslint, ensure your ESLint config does not conflict with babel-eslint; both parsers may be active.","severity":"gotcha","affected_versions":"all"},{"fix":"Test --fix on a small file first; disable autofix for rules known to conflict with Flow.","message":"ESLint's --fix may produce unexpected results with Flow type syntax; some rules may not support autofix.","severity":"gotcha","affected_versions":"all"},{"fix":"Remove the option; modern parsers support object rest/spread natively.","message":"The 'experimentalObjectRestSpread' option is no longer needed as of ECMAScript 2018.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install --save-dev hermes-eslint' or ensure it's in your package.json.","cause":"hermes-eslint not installed or ESLint cannot resolve the parser.","error":"Error: Cannot find module 'hermes-eslint'"},{"fix":"Verify .eslintrc JSON is valid and that 'parser' is set to exactly \"hermes-eslint\".","cause":"Incorrect JSON syntax in .eslintrc or parser name is not a string.","error":"Error: Failed to load parser 'hermes-eslint' (from .eslintrc)"},{"fix":"Use dynamic import: const { parseForESLint } = await import('hermes-eslint'); or ensure you are in an ESM context.","cause":"Importing the module incorrectly in a CommonJS environment.","error":"TypeError: parseForESLint is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}