eslint-plugin-ember icon indicating copy to clipboard operation
eslint-plugin-ember copied to clipboard

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

Open NullVoxPopuli opened this issue 2 years ago • 3 comments

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 avatar Aug 14 '23 18:08 NullVoxPopuli

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)

NullVoxPopuli avatar Aug 14 '23 18:08 NullVoxPopuli

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:

  • https://github.com/emberjs/ember.js/blob/main/packages/%40ember/-internals/glimmer/tests/integration/components/input-curly-test.js
  • https://github.com/emberjs/ember.js/blob/main/packages/%40ember/-internals/glimmer/tests/integration/components/input-angle-test.js
  • there is no tests for it.

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

lifeart avatar Aug 14 '23 18:08 lifeart

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

NullVoxPopuli avatar Aug 14 '23 18:08 NullVoxPopuli