Skip to content

Port template-no-accesskey-attribute rule from PR #2371#2388

Closed
Copilot wants to merge 3 commits intomasterfrom
copilot/add-template-no-accesskey-attribute-rule
Closed

Port template-no-accesskey-attribute rule from PR #2371#2388
Copilot wants to merge 3 commits intomasterfrom
copilot/add-template-no-accesskey-attribute-rule

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 17, 2026

Splits out ember/template-no-accesskey-attribute from umbrella PR #2371. Disallows accesskey attributes on HTML elements in templates due to screen reader and keyboard navigation conflicts.

Implementation

  • Rule: Checks GlimmerElementNode for GlimmerAttrNode with name === 'accesskey'
  • Auto-fix: Removes attribute including preceding whitespace
  • Category: Best Practices (accessibility)

Example

// ❌ Invalid
<template>
  <button accesskey="s">Save</button>
</template>

// ✅ Valid  
<template>
  <button>Save</button>
</template>

Files

  • lib/rules/template-no-accesskey-attribute.js - Rule implementation (54 lines)
  • tests/lib/rules/template-no-accesskey-attribute.js - Test coverage (4 valid, 4 invalid cases)
  • docs/rules/template-no-accesskey-attribute.md - Documentation

Part of splitting PR #2371 into individual rules. No config changes per agreed constraints.

Original prompt

Repository: ember-cli/eslint-plugin-ember
Base branch: master

We are splitting umbrella PR #2371 into one PR per lint rule.

Already extracted/merged earlier:

In progress / most recently created:

  • PR for template-link-href-attributes (created via prior task)

Now create the NEXT PR in the agreed order, with exactly ONE rule:

  • ember/template-no-accesskey-attribute

Constraints:

  • Do NOT bring forward strict-gjs / strict-gts configs (no config files, no README mentions, no badges).
  • PR must contain only this rule’s implementation + tests + docs (+ minimal shared utilities strictly required).
  • Ensure no unrelated changes.
  • Ensure tests/lint pass.

PR metadata:

Implementation notes:

  • Start from master.
  • Pull only the diffs relevant to this rule from PR Port over all ember-template-lint rules #2371.
  • Register/export the rule so it can be used.
  • Add docs at docs/rules/template-no-accesskey-attribute.md.
  • Add appropriate tests in the repo’s standard rule test location.

Deliverable:

  • Open the PR against master.

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Port template-no-accesskey-attribute rule from PR #2371 Port template-no-accesskey-attribute rule from PR #2371 Feb 17, 2026
Copilot AI requested a review from NullVoxPopuli February 17, 2026 00:41
@NullVoxPopuli NullVoxPopuli deleted the copilot/add-template-no-accesskey-attribute-rule branch February 17, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants