Skip to content

recommended: disable noisy stylistic rules; demote prefer-native-element#47

Draft
johanrd wants to merge 1 commit into
mainfrom
presets-signal-first
Draft

recommended: disable noisy stylistic rules; demote prefer-native-element#47
johanrd wants to merge 1 commit into
mainfrom
presets-signal-first

Conversation

@johanrd
Copy link
Copy Markdown
Owner

@johanrd johanrd commented May 22, 2026

Makes :recommended signal-first: surface content-model bugs, a11y issues, and missing required attributes — not stylistic preferences that fire on legitimate Ember/Glimmer code.

Changes

  • no-inline-style: off — bans the style= attribute, which breaks legitimate runtime style-binding (<div style={{this.computedStyle}}>). Use a separate stylelint pipeline if you want inline-style policy.
  • void-style: off — html-validate defaults to omit, Ember/Glimmer convention is selfclosing, and mixing is harmless. Previously :gts-recommended forced selfclosing, which fought projects using omit. Now disabled entirely; enforce via ember-template-lint if you want a house style.
  • prefer-native-element: warn (was error) — real a11y signal (<div role="button"> should usually be <button>), but design systems intentionally wrap generic elements with role + keyboard handling. Demoted so it surfaces without failing builds; promote back to error per-project if desired.

:recommended and :gts-recommended now resolve to identical rule sets. The :gts-recommended alias stays for backwards compatibility, so existing consumers' extends keep working.

Context

Same spirit as the discussion in #38 (don't make :recommended pedantic) — though #38 is specifically about technique-based WCAG rules (e.g. wcag/h63), while this PR addresses stylistic rules.

Evidence from the ecosystem CI

The ecosystem-CI harness (#24) has to suppress these exact three rules in its own config (ECOSYSTEM_RULE_OVERRIDES) to keep the regression signal readable across 12 real-world Ember repos — they generate a large share of the noise on otherwise-legitimate code. That volume is the concrete argument for this change: if :recommended makes real-world Ember projects that noisy out of the box, the default is mis-calibrated. If this PR lands, the ecosystem override becomes redundant and can be dropped.

Notes

  • Behavior change for every consumer of :recommended / :gts-recommended — needs an appropriate release-plan label.
  • Plugin suite green (288 passed, 1 expected fail).

Goal: ":recommended" should give "pure value" — content-model bugs,
a11y issues, missing required attributes — not pedantic style
preferences. Trim the html-validate-recommended noise that fires on
legitimate Ember/Glimmer patterns:

- `no-inline-style: off` — bans `style=` attribute. Breaks legitimate
  runtime style-binding (`<div style={{this.computedStyle}}>`). Use a
  separate stylelint pipeline for inline-style policy if needed.

- `void-style: off` — html-validate defaults to omit, Ember/Glimmer
  convention is selfclosing, mixing is harmless. Previously the
  `:gts-recommended` preset overrode to `selfclosing`, which fought
  projects using the omit form. Now disabled entirely; teams enforce
  via `ember-template-lint` if they want that policy.

- `prefer-native-element: warn` — kept on but demoted from error.
  Real a11y signal (`<div role="button">` should usually be
  `<button>`), but design systems intentionally wrap generic elements
  with role+keyboard handling. Surfaced as a warning so it doesn't
  fail builds; teams can promote back to error per-project.

`:recommended` and `:gts-recommended` now resolve to identical rule
sets. The alias stays for backwards compatibility — existing
consumers' `extends` keep working.

151/151 pass.
@johanrd johanrd marked this pull request as draft May 22, 2026 09:41
johanrd added a commit that referenced this pull request May 22, 2026
The void-style / no-inline-style / prefer-native-element suppressions live
in the ecosystem runner's config (ECOSYSTEM_RULE_OVERRIDES) instead of the
plugin's shipped :recommended / :gts-recommended presets, which return to
their original form. Net rule set applied to the targets is unchanged, so
baselines are untouched (verified: ember-modifier, super-rentals,
ember-primitives all clean vs baseline). Whether the plugin's recommended
set should adopt the same suppressions is tracked in PR #47, not here.
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.

1 participant