Skip to content

feat: add (opt-in ember-template-lint parity) template-lint-migration config #2702

Merged
NullVoxPopuli merged 1 commit intoember-cli:masterfrom
johanrd:feat/recommended-template-config
Apr 20, 2026
Merged

feat: add (opt-in ember-template-lint parity) template-lint-migration config #2702
NullVoxPopuli merged 1 commit intoember-cli:masterfrom
johanrd:feat/recommended-template-config

Conversation

@johanrd
Copy link
Copy Markdown
Contributor

@johanrd johanrd commented Apr 13, 2026

Summary

Adds eslint-plugin-ember/configs/template-lint-migration' — an opt-in flat config that enables the same ~94 template rules as ember-template-lint's recommended preset, making it straightforward to drop ember-template-lint and keep equivalent coverage.

import eslintPluginEmberRecommended from 'eslint-plugin-ember/configs/recommended';
import eslintPluginEmberTemplateLintMigration from 'eslint-plugin-ember/configs/template-lint-migration'';

export default [
  ...eslintPluginEmberRecommended,
  ...eslintPluginEmberTemplateLintMigration,
  {
    rules: {
      // migrate overrides from .template-lintrc.*
      'ember/template-no-bare-strings': ['error', { allowlist: ['×'] }],
      'ember/template-no-inline-styles': 'off',
    },
  },
];

Why not part of recommended?

Template linting is a separate concern from Ember JS linting, and many projects will want to adopt it incrementally or tune individual rules (e.g. no-bare-strings allowlists, no-inline-styles) before committing to the full set. Keeping it opt-in avoids a breaking change and lets teams migrate at their own pace.

Why no gjs/gts overrides?

ember-template-lint's recommended config disables several rules for .gjs/.gts files (no-curly-component-invocation, no-implicit-this, builtin-component-arguments, no-builtin-form-components, no-unknown-arguments-for-builtin-components) because template-lint has no JS scope tracker and can't distinguish a JS-scoped binding from an implicit-this lookup inside <template>.

The ported rules in this plugin don't have that limitation:

  • no-implicit-this and no-curly-component-invocation walk ESLint's scope chain and skip any identifier that resolves to a JS binding (import, const, param, block param).
  • no-builtin-form-components explicitly checks filename.endsWith('.gjs/.gts') and only flags components imported from @ember/component.
  • no-unknown-arguments-for-builtin-components checks whether a tag is shadowed by a JS-scope variable before flagging.

Adding the overrides would suppress correct behaviour in gjs/gts, not fix a real problem.

@johanrd johanrd marked this pull request as draft April 13, 2026 19:56
@johanrd johanrd force-pushed the feat/recommended-template-config branch from 88a6caf to 4f24085 Compare April 13, 2026 23:22
@johanrd johanrd marked this pull request as ready for review April 14, 2026 12:37
@johanrd johanrd changed the title feat: add recommended-template config (opt-in ember-template-lint parity) feat: add (opt-in ember-template-lint parity) recommended-template config Apr 14, 2026
@johanrd johanrd force-pushed the feat/recommended-template-config branch from 76a147f to 142ae7e Compare April 20, 2026 13:43
@NullVoxPopuli NullVoxPopuli changed the title feat: add (opt-in ember-template-lint parity) recommended-template config feat: add (opt-in ember-template-lint parity) template-lint-migration config Apr 20, 2026
@johanrd johanrd force-pushed the feat/recommended-template-config branch 2 times, most recently from 94ec3c7 to 37c416d Compare April 20, 2026 14:21
Provides a drop-in replacement for the ember-template-lint `recommended`
preset so consumers can migrate off ember-template-lint onto this plugin
with an equivalent set of rules enabled.

The name makes the migration-from-template-lint intent explicit and avoids
implying that the rule set has been audited for current relevance (it
mirrors upstream). The set is expected to change in the next major via RFC.

Includes:
- Flat config at lib/config/template-lint-migration.js
- Legacy (pre-ESLint 9) config at lib/config-legacy/template-lint-migration.js
- eslint-doc-generator configEmoji entry + regenerated rule docs and README
- plugin-exports test updated
- README section on migrating from ember-template-lint, including how to
  rewrite inline template-lint-disable directives and how to disable a
  rule for an entire .gjs/.gts file via a JS-region eslint-disable
@johanrd johanrd force-pushed the feat/recommended-template-config branch from 37c416d to 7bc1404 Compare April 20, 2026 16:16
@NullVoxPopuli NullVoxPopuli merged commit 1ef2dd9 into ember-cli:master Apr 20, 2026
10 checks passed
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