Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
9e8e45e
Prepare Release v13.1.4 using 'release-plan'
github-actions[bot] Apr 27, 2026
0cf348b
Merge pull request #2750 from ember-cli/release-preview
NullVoxPopuli Apr 27, 2026
148a2a3
feat: add template-require-input-type — reject invalid input types; o…
johanrd Apr 27, 2026
675427a
Merge pull request #2763 from johanrd/html-validate/template-require-…
NullVoxPopuli Apr 28, 2026
493f154
Update parser
NullVoxPopuli Apr 28, 2026
4ae4688
Merge pull request #2766 from ember-cli/nvp/update-parser
NullVoxPopuli Apr 28, 2026
e5baa77
Prepare Release v13.2.0 using 'release-plan'
github-actions[bot] Apr 28, 2026
c52084a
Merge pull request #2765 from ember-cli/release-preview
NullVoxPopuli Apr 28, 2026
6a8d7b7
docs: add glimmer-attribute-behavior reference
johanrd Apr 28, 2026
6052bae
docs: cite ember-source 6.12, drop separate Glimmer version
johanrd Apr 28, 2026
8c4c540
docs(glimmer-attribute-behavior): rewrite from verified empirical data
johanrd Apr 28, 2026
e0a8d17
fix(docs): use querySelector to satisfy unicorn/prefer-query-selector
johanrd Apr 28, 2026
1b384a7
docs(glimmer-attribute-behavior): add "Reading attribute values in ru…
johanrd Apr 28, 2026
bb1ebb3
feat(utils): add glimmer-attr-presence — encodes the verified renderi…
johanrd Apr 28, 2026
bfb839d
fix(glimmer-attr-presence): correctness fixes + adopt property-inform…
johanrd Apr 28, 2026
ba77832
feat: add template-no-aria-label-misuse — flag aria-label on roles wi…
johanrd Apr 27, 2026
ee48aec
fix: add docs header marker; tests for valueless and empty-literal ar…
johanrd Apr 27, 2026
9a98a03
fix(template-no-aria-label-misuse): normalize whitespace and expand s…
johanrd Apr 28, 2026
c8ab616
fix: regenerate rule doc header
johanrd Apr 28, 2026
04e74fb
fix: use classifyAttribute for aria-label + tabindex (rows h6, h9, h1…
johanrd Apr 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .release-plan.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"solution": {
"eslint-plugin-ember": {
"impact": "patch",
"oldVersion": "13.1.2",
"newVersion": "13.1.3",
"impact": "minor",
"oldVersion": "13.1.4",
"newVersion": "13.2.0",
"tagName": "latest",
"constraints": [
{
"impact": "patch",
"reason": "Appears in changelog section :bug: Bug Fix"
"impact": "minor",
"reason": "Appears in changelog section :rocket: Enhancement"
},
{
"impact": "patch",
"reason": "Appears in changelog section :house: Internal"
"reason": "Appears in changelog section :bug: Bug Fix"
}
],
"pkgJSONPath": "./package.json"
}
},
"description": "## Release (2026-04-25)\n\n* eslint-plugin-ember 13.1.3 (patch)\n\n#### :bug: Bug Fix\n* `eslint-plugin-ember`\n * [#2730](https://github.com/ember-cli/eslint-plugin-ember/pull/2730) BUGFIX: template-require-valid-alt-text — reject empty-string aria-label/labelledby/alt on <input type=image>, <object>, <area> ([@johanrd](https://github.com/johanrd))\n * [#2729](https://github.com/ember-cli/eslint-plugin-ember/pull/2729) BUGFIX: template-no-invalid-role — support DPUB/Graphics-ARIA and role-fallback lists ([@johanrd](https://github.com/johanrd))\n * [#2726](https://github.com/ember-cli/eslint-plugin-ember/pull/2726) BUGFIX: template-no-unsupported-role-attributes — honor aria-query attribute constraints ([@johanrd](https://github.com/johanrd))\n * [#2727](https://github.com/ember-cli/eslint-plugin-ember/pull/2727) BUGFIX: template-no-redundant-role — case-insensitive match + <select>→combobox ([@johanrd](https://github.com/johanrd))\n\n#### :house: Internal\n* `eslint-plugin-ember`\n * [#2746](https://github.com/ember-cli/eslint-plugin-ember/pull/2746) refactor: extract isNativeElement util (fix component-vs-HTML-tag misclassification) ([@johanrd](https://github.com/johanrd))\n\n#### Committers: 1\n- [@johanrd](https://github.com/johanrd)\n"
"description": "## Release (2026-04-28)\n\n* eslint-plugin-ember 13.2.0 (minor)\n\n#### :rocket: Enhancement\n* `eslint-plugin-ember`\n * [#2763](https://github.com/ember-cli/eslint-plugin-ember/pull/2763) feat: add template-require-input-type ([@johanrd](https://github.com/johanrd))\n\n#### :bug: Bug Fix\n* `eslint-plugin-ember`\n * [#2766](https://github.com/ember-cli/eslint-plugin-ember/pull/2766) Update parser ([@NullVoxPopuli](https://github.com/NullVoxPopuli))\n\n#### Committers: 2\n- [@NullVoxPopuli](https://github.com/NullVoxPopuli)\n- [@johanrd](https://github.com/johanrd)\n"
}
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# Changelog

## Release (2026-04-28)

* eslint-plugin-ember 13.2.0 (minor)

#### :rocket: Enhancement
* `eslint-plugin-ember`
* [#2763](https://github.com/ember-cli/eslint-plugin-ember/pull/2763) feat: add template-require-input-type ([@johanrd](https://github.com/johanrd))

#### :bug: Bug Fix
* `eslint-plugin-ember`
* [#2766](https://github.com/ember-cli/eslint-plugin-ember/pull/2766) Update parser ([@NullVoxPopuli](https://github.com/NullVoxPopuli))

#### Committers: 2
- [@NullVoxPopuli](https://github.com/NullVoxPopuli)
- [@johanrd](https://github.com/johanrd)

## Release (2026-04-27)

* eslint-plugin-ember 13.1.4 (patch)

#### :bug: Bug Fix
* `eslint-plugin-ember`
* [#2752](https://github.com/ember-cli/eslint-plugin-ember/pull/2752) Update ember-eslint-parser to 0.11.2 ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
* [#2728](https://github.com/ember-cli/eslint-plugin-ember/pull/2728) BUGFIX: template-require-mandatory-role-attributes — lowercase role + split whitespace role lists ([@johanrd](https://github.com/johanrd))

#### :house: Internal
* `eslint-plugin-ember`
* [#2748](https://github.com/ember-cli/eslint-plugin-ember/pull/2748) refactor: extract `html-interactive-content` util (HTML §3.2.5.2.7 authority) ([@johanrd](https://github.com/johanrd))

#### Committers: 2
- [@NullVoxPopuli](https://github.com/NullVoxPopuli)
- [@johanrd](https://github.com/johanrd)

## Release (2026-04-25)

* eslint-plugin-ember 13.1.3 (patch)
Expand Down
72 changes: 38 additions & 34 deletions README.md

Large diffs are not rendered by default.

330 changes: 330 additions & 0 deletions docs/glimmer-attribute-behavior.md

Large diffs are not rendered by default.

85 changes: 85 additions & 0 deletions docs/rules/template-no-aria-label-misuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# ember/template-no-aria-label-misuse

<!-- end auto-generated rule header -->

Flag `aria-label` and `aria-labelledby` on elements whose computed role
prohibits an accessible name from author. On a plain `<div>` the role is
`generic`, whose [`prohibitedProps` per WAI-ARIA 1.2](https://www.w3.org/TR/wai-aria-1.2/#generic)
list both `aria-label` and `aria-labelledby` — assistive technology is
expected to ignore them.

## How the role is resolved

Roles are looked up via [`aria-query`](https://www.npmjs.com/package/aria-query),
the authoritative WAI-ARIA data package:

- **Explicit**: if the element has a static `role="..."`, that role is used.
`role="presentation"` and `role="none"` cause the element to be skipped
(author has removed it from the a11y tree).
- **Implicit**: `aria-query.elementRoles` gives the spec-mapped role for
each HTML tag. Conditional entries (e.g. `<section aria-label="...">`
maps to `region`, `<a href>` maps to `link`) are matched against the
element's static attributes; the most specific match wins.

If no role can be resolved (unknown tag, component invocation, or
element without an aria-query entry), the rule skips — consistent with
the plugin's "when in doubt, don't flag" stance.

## Escape hatches (not flagged by default)

- Elements with `tabindex` (any value). An explicit `tabindex` signals
author-intent-to-interact, even when the computed ARIA role is still
generic. Flagging here has a high false-positive cost (the author
_wants_ the label read on focus) relative to the true-positive it
would catch. Disable this hatch with `strictTabindex: true` below.
- Elements with `role="presentation"` / `role="none"`.
- Elements whose role is inherently nameable (e.g. `button`, `link`,
`main`, `navigation`, `region`).

## Configuration

- `strictTabindex` (`boolean`, default `false`): when `true`, the
tabindex escape hatch is disabled — a `<div tabindex="0" aria-label="x">`
is flagged as strictly as any other generic element. Enable this for
strict spec-role enforcement.

```js
module.exports = {
rules: {
'ember/template-no-aria-label-misuse': ['error', { strictTabindex: true }],
},
};
```

## Examples

Forbids:

```hbs
<div aria-label='dialog'>...</div>
<span aria-labelledby='title'>...</span>
<p aria-label='note'>Note text</p>
<a aria-label='missing-href'>...</a>
<img aria-label='x' alt='' src='/y.png' />
```

Allows:

```hbs
<button aria-label='Close'>x</button>
<main aria-label='Primary'>...</main>
<section aria-label='About'>...</section>
{{! becomes role=region }}
<form aria-label='Search'>...</form>
{{! becomes role=form }}
<div role='button' aria-label='Custom'>...</div>
<span tabindex='0' aria-label='Focusable'>...</span>
```

## References

- [WAI-ARIA 1.2: Accessible Name Calculation](https://www.w3.org/TR/wai-aria-1.2/#namecalculation)
- [WAI-ARIA 1.2: `aria-label` property definition](https://www.w3.org/TR/wai-aria-1.2/#aria-label)
- [HTML-AAM: ARIA role mappings](https://www.w3.org/TR/html-aam-1.1/#html-element-role-mappings)
- [`aria-query`](https://www.npmjs.com/package/aria-query) (authoritative ARIA data, already a dep of this plugin)
- Rule inspired by [`html-validate`'s `aria-label-misuse`](https://gitlab.com/html-validate/html-validate/-/blob/v10.13.1/src/rules/aria-label-misuse.ts) (MIT).
66 changes: 66 additions & 0 deletions docs/rules/template-require-input-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# ember/template-require-input-type

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end auto-generated rule header -->

This rule rejects `<input type="...">` values that are not one of the input
types defined by the HTML spec, and (optionally) requires every `<input>` to
declare a `type` attribute.

An invalid value like `<input type="foo">` silently falls back to the Text
state — the browser reports no error, but the author's intent (validation,
inputmode hint, platform keyboard) is lost. That's a genuine silent-failure
class, which this rule always flags and auto-fixes to `type="text"`.

A missing `type` attribute (`<input />`) is _spec-compliant_ — the
missing-value default is the Text state — so flagging it is a style /
consistency choice, not a correctness one. Opt in with `requireExplicit: true`
if your team wants parity with `template-require-button-type`.

## Examples

This rule **forbids** the following (always):

```hbs
<input type='' />
<input type='foo' />
<input type='TEXTY' />
```

With `requireExplicit: true` the rule **also forbids**:

```hbs
<input />
<input name='email' />
```

This rule **allows** the following:

```hbs
<input type='text' />
<input type='email' />
<input type='checkbox' />
<input type={{this.inputType}} />
```

Dynamic values such as `type={{this.inputType}}` are not flagged at lint time.

## Configuration

- `requireExplicit` (`boolean`, default `false`): when true, also flag
`<input>` elements that have no `type` attribute. Auto-fix inserts
`type="text"`.

```js
module.exports = {
rules: {
'ember/template-require-input-type': ['error', { requireExplicit: true }],
},
};
```

## References

- [HTML spec — the input element](https://html.spec.whatwg.org/multipage/input.html#the-input-element)
- Adapted from [`html-validate`'s `no-implicit-input-type`](https://html-validate.org/rules/no-implicit-input-type.html) (MIT).
20 changes: 2 additions & 18 deletions lib/rules/template-block-indentation.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
'use strict';

const { htmlVoidElements } = require('html-void-elements');
const editorConfigUtil = require('../utils/editorconfig');

const VOID_TAGS = new Set([
'area',
'base',
'br',
'col',
'command',
'embed',
'hr',
'img',
'input',
'keygen',
'link',
'meta',
'param',
'source',
'track',
'wbr',
]);
const VOID_TAGS = new Set(htmlVoidElements);
const IGNORED_ELEMENTS = new Set(['pre', 'script', 'style', 'textarea']);

function isControlChar(char) {
Expand Down
Loading
Loading