recommended: disable noisy stylistic rules; demote prefer-native-element#47
Draft
johanrd wants to merge 1 commit into
Draft
recommended: disable noisy stylistic rules; demote prefer-native-element#47johanrd wants to merge 1 commit into
johanrd wants to merge 1 commit into
Conversation
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes
:recommendedsignal-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 thestyle=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 toomit, Ember/Glimmer convention isselfclosing, and mixing is harmless. Previously:gts-recommendedforcedselfclosing, which fought projects usingomit. Now disabled entirely; enforce viaember-template-lintif you want a house style.prefer-native-element: warn(waserror) — 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 toerrorper-project if desired.:recommendedand:gts-recommendednow resolve to identical rule sets. The:gts-recommendedalias stays for backwards compatibility, so existing consumers'extendskeep working.Context
Same spirit as the discussion in #38 (don't make
:recommendedpedantic) — 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:recommendedmakes 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
:recommended/:gts-recommended— needs an appropriate release-plan label.