{"id":13118,"library":"ember-eslint-parser","title":"Ember ESLint Parser","description":"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.","status":"active","version":"0.10.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/ember-tooling/ember-eslint-parser","tags":["javascript"],"install":[{"cmd":"npm install ember-eslint-parser","lang":"bash","label":"npm"},{"cmd":"yarn add ember-eslint-parser","lang":"bash","label":"yarn"},{"cmd":"pnpm add ember-eslint-parser","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for linting Glimmer TypeScript (.gts) files and generally recommended for TypeScript support.","package":"@typescript-eslint/parser","optional":false}],"imports":[{"note":"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.","symbol":"ember-eslint-parser","correct":"{ files: ['**/*.gjs', '**/*.gts'], parser: 'ember-eslint-parser' }"},{"note":"Used in ESLint's flat config (`eslint.config.mjs`) for Handlebars (`.hbs`) files. Requires ESM syntax for import.","wrong":"const hbsParser = require('ember-eslint-parser/hbs');","symbol":"hbsParser","correct":"import hbsParser from 'ember-eslint-parser/hbs';"}],"quickstart":{"code":"import hbsParser from 'ember-eslint-parser/hbs';\n\nexport default [\n  {\n    files: ['**/*.gjs'],\n    parser: 'ember-eslint-parser',\n    plugins: ['ember'],\n    extends: [\n      'eslint:recommended',\n      'plugin:ember/recommended',\n      'plugin:ember/recommended-gjs'\n    ]\n  },\n  {\n    files: ['**/*.gts'],\n    parser: 'ember-eslint-parser',\n    plugins: ['ember'],\n    extends: [\n      'eslint:recommended',\n      'plugin:ember/recommended',\n      'plugin:ember/recommended-gts'\n    ]\n  },\n  {\n    files: ['**/*.hbs'],\n    languageOptions: {\n      parser: hbsParser\n    }\n  }\n];","lang":"javascript","description":"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."},"warnings":[{"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.","message":"SemVer compatibility is primarily maintained for `eslint-plugin-ember`. Other direct consumers of `ember-eslint-parser` may experience breaking changes outside of typical SemVer expectations.","severity":"gotcha","affected_versions":">=0.1.0"},{"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`.","message":"When 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.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"For full static analysis and improved linting accuracy regarding variable definitions, migrate Handlebars templates to `.gjs` or `.gts` files where possible.","message":"In 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`.","severity":"gotcha","affected_versions":">=0.6.0"},{"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.","message":"Version 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.","severity":"breaking","affected_versions":"0.7.0"},{"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.","message":"Version 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.","severity":"breaking","affected_versions":"<0.5.9"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Install the peer dependency: `npm install --save-dev @typescript-eslint/parser` or `pnpm add -D @typescript-eslint/parser`.","cause":"Attempting to lint a .gts file without `@typescript-eslint/parser` installed as a dependency.","error":"Error: Cannot find module '@typescript-eslint/parser'"},{"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.","cause":"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`.","error":"ESLint: 'someVariable' is not defined. (no-undef)"},{"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.","cause":"Possible incompatibility issue with `typescript-eslint` or other parser-related dependencies, especially after upgrading or with mismatched versions.","error":"TypeError: Cannot read properties of undefined (reading 'body') at Parser.parse"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":""}