Registry / testing / ember-eslint-parser

ember-eslint-parser

JSON →
library0.10.0jsnpmunverified

ember-eslint-parser is a specialized ESLint parser designed to understand and lint Ember.js specific file formats: Glimmer JavaScript (`.gjs`), Glimmer TypeScript (`.gts`), and Handlebars (`.hbs`) template files. As of its current stable version, 0.10.0, released in April 2026, it receives frequent minor updates, often monthly or bi-monthly, reflecting active development. The parser works in conjunction with `eslint-plugin-ember` to provide comprehensive static analysis for Ember applications. Its key differentiator is the ability to parse embedded Glimmer templates within JavaScript/TypeScript files and traditional Handlebars templates, enabling a unified linting experience across an Ember project's varied file types, particularly crucial for modern Ember Octane and Polaris applications.

npm install ember-eslint-parser
INSTALL
IMPORT
SIG · EMBER-ESLINT-PARSE
E
ember-eslint-parser
testingjavascriptv0.10.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.

ember-eslint-parser
{ files: ['**/*.gjs', '**/*.gts'], parser: 'ember-eslint-parser' }
This is configured as a string in ESLint's `parser` option for .gjs and .gts files. It is not directly imported into user JavaScript/TypeScript.
hbsParser
import hbsParser from 'ember-eslint-parser/hbs';
const hbsParser = require('ember-eslint-parser/hbs');
Used in ESLint's flat config (`eslint.config.mjs`) for Handlebars (`.hbs`) files. Requires ESM syntax for import.

This ESLint flat configuration demonstrates how to enable `ember-eslint-parser` for Glimmer JavaScript (.gjs), Glimmer TypeScript (.gts), and Handlebars (.hbs) files, integrating with `eslint-plugin-ember` recommended presets.

import hbsParser from 'ember-eslint-parser/hbs'; export default [ { files: ['**/*.gjs'], parser: 'ember-eslint-parser', plugins: ['ember'], extends: [ 'eslint:recommended', 'plugin:ember/recommended', 'plugin:ember/recommended-gjs' ] }, { files: ['**/*.gts'], parser: 'ember-eslint-parser', plugins: ['ember'], extends: [ 'eslint:recommended', 'plugin:ember/recommended', 'plugin:ember/recommended-gts' ] }, { files: ['**/*.hbs'], languageOptions: { parser: hbsParser } } ];
Debug
Known issues
gotchaSemVer compatibility is primarily maintained for `eslint-plugin-ember`. Other direct consumers of `ember-eslint-parser` may experience breaking changes outside of typical SemVer expectations.
fix
It is recommended to use this parser via `eslint-plugin-ember` and update both packages in sync. Exercise caution if using this parser directly for custom tooling.
affects: >=0.1.0
breakingWhen linting Glimmer TypeScript (.gts) files, `ember-eslint-parser` requires `@typescript-eslint/parser` to be discoverable in the project's dependencies. If not found, it will throw an error.
fix
Ensure `@typescript-eslint/parser` is installed as a peer dependency in your project. For example: `npm install --save-dev @typescript-eslint/parser` or `pnpm add -D @typescript-eslint/parser`.
affects: >=0.1.0
gotchaIn traditional Handlebars (`.hbs`) files, all undeclared locals are assumed to be defined at runtime. This behavior is by design to prevent `no-undef` errors but limits static analysis capabilities compared to `.gjs`/`.gts`.
fix
For full static analysis and improved linting accuracy regarding variable definitions, migrate Handlebars templates to `.gjs` or `.gts` files where possible.
affects: >=0.6.0
breakingVersion 0.7.0 introduced API compatibility fixes for `content-tag` v4, `html-tags` v5, and `mathml-tag-names` v4. Projects using older versions of these underlying libraries might experience issues.
fix
Ensure your project's dependencies are updated to compatible versions of `content-tag`, `html-tags`, and `mathml-tag-names` when upgrading to `ember-eslint-parser` v0.7.0 or newer.
affects: 0.7.0
breakingVersion 0.5.9 provided a fix for lint-fixing with `typescript-eslint` version 8. Older versions of `ember-eslint-parser` may have had compatibility issues or unexpected behavior with `typescript-eslint` v8.
fix
If encountering issues with ESLint autofixing or parsing when using `typescript-eslint` v8, ensure `ember-eslint-parser` is updated to at least v0.5.9.
affects: <0.5.9
Errors
Common errors & fixes
Error: Cannot find module '@typescript-eslint/parser'
Attempting to lint a .gts file without `@typescript-eslint/parser` installed as a dependency.
fix
Install the peer dependency: `npm install --save-dev @typescript-eslint/parser` or `pnpm add -D @typescript-eslint/parser`.
ESLint: 'someVariable' is not defined. (no-undef)
This error occurs in a `.hbs` file for a variable that is expected to be present at runtime but is not explicitly declared as a block param. This rule is often less effective in `.hbs`.
fix
For `.hbs` files, explicitly pass variables as block parameters (e.g., `<MyComponent as |someVariable|>`) or consider migrating to `.gjs`/`.gts` for improved static analysis. In `.gjs`/`.gts`, ensure variables are correctly imported or declared.
TypeError: Cannot read properties of undefined (reading 'body') at Parser.parse
Possible incompatibility issue with `typescript-eslint` or other parser-related dependencies, especially after upgrading or with mismatched versions.
fix
Ensure `ember-eslint-parser`, `eslint-plugin-ember`, and `@typescript-eslint/parser` are all updated to their latest compatible versions. Check your `package.json` for conflicting versions of these or related AST-parsing libraries.
Upgrade
Version history
0.10.0latest on npm
Audit
Dependencies
@typescript-eslint/parserrequiredRequired for linting Glimmer TypeScript (.gts) files and generally recommended for TypeScript support.
Agent activity
5 hits · last 30 days
node
4
Bingbot
1
Resources