Skip to content

feat: re-export hbs parser and document HBS flat-config setup#2715

Merged
NullVoxPopuli merged 2 commits into
ember-cli:masterfrom
johanrd:feat/hbs-parser-reexport
Apr 21, 2026
Merged

feat: re-export hbs parser and document HBS flat-config setup#2715
NullVoxPopuli merged 2 commits into
ember-cli:masterfrom
johanrd:feat/hbs-parser-reexport

Conversation

@johanrd
Copy link
Copy Markdown
Contributor

@johanrd johanrd commented Apr 21, 2026

Summary

  • Re-exports hbsParser as a named export from eslint-plugin-ember/recommended (alongside the existing parser for gjs/gts). Lets consumers set up .hbs linting without adding ember-eslint-parser as a direct devDep.
  • Adds a "Linting .hbs files" subsection under "Migrating from ember-template-lint" with a ready-to-paste flat-config block and a warning about the rule-merging pitfall when a typescript-eslint shared config's blocks (e.g. recommendedTypeChecked) don't set their own files and therefore match .hbs alongside everything else.

Motivation

A user migrating from ember-template-lint hit:

Parsing error: was not found by the project service because the extension for the file (.hbs) is non-standard.

and later:

Error while loading rule @typescript-eslint/await-thenable: You have used a rule which requires type information.

Both errors come from @typescript-eslint/parser's project service being applied to .hbs files via a broad shared-config block. The README didn't document the HBS flat-config wiring, so this was left for each consumer to figure out. This PR closes that gap.

Test plan

  • npx vitest run tests/recommended.js tests/plugin-exports.js tests/config-setup.js — all pass
  • import { hbsParser } from 'eslint-plugin-ember/recommended' resolves and exposes parseForESLint
  • npx markdownlint README.md clean

Adds `hbsParser` as a named export alongside the existing `parser` (gjs/gts) in
`eslint-plugin-ember/recommended`, so consumers don't need a direct `ember-eslint-parser`
devDep to wire up `.hbs` linting. README migration section now shows the HBS block
and warns about the rule-merging pitfall when a typescript-eslint shared config
matches `.hbs` (e.g. `recommendedTypeChecked` without its own `files` glob).
@johanrd johanrd marked this pull request as draft April 21, 2026 10:19
The .mjs override meant to disable `import/no-unresolved` but silently
never did because of the typo. Surfaced when the new subpath import of
`ember-eslint-parser/hbs` tripped the rule; the existing main-entry
import resolved fine so the typo went unnoticed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants