ember-cli / eslint-plugin-ember

An ESLint plugin that provides set of rules for Ember applications based on commonly known good practices.
MIT License
260 stars 202 forks source link

New lint: prevent usage of `Input` and `Textarea` (the ember default components) #1932

Open NullVoxPopuli opened 1 year ago

NullVoxPopuli commented 1 year ago

these are the last components using two-way binding, and they are awkward, and not well defined in the documentation.

Native <input> and <textarea> work way better (since octane), so the docs can eventually be updated to show how to use those (or use a bindless approach, like here).

NullVoxPopuli commented 1 year ago

Last opinion on this, that I know of, was in 2014: https://github.com/emberjs/ember.js/pull/4352#issuecomment-63117573

And that was way before Octane, before we could "have nice things" (such as here)

lifeart commented 1 year ago

It looks like issue for ember-template-lint,

We already have rule to allow/forbid some builtin components usages: https://github.com/ember-template-lint/ember-template-lint/blob/8ad1bc299e79802a17debae6518c75a038d63735/docs/rule/builtin-component-arguments.md?plain=1#L18

At the moment, Input type="radio" is not really supported by ember:

Related conversation: https://github.com/emberjs/ember.js/pull/4352

NullVoxPopuli commented 1 year ago

It looks like issue for ember-template-lint,

A little bit both, because with gjs/gts we can import these things now. Like, the @ember/render-modifiers lint only checks the imports: https://github.com/ember-cli/eslint-plugin-ember/blob/master/lib/rules/no-at-ember-render-modifiers.js#L32