This rule disallows the use of Ember's built-in form components (Input and Textarea) from @ember/component and encourages using native HTML elements instead.
Ember's built-in form components (Input and Textarea) were designed to bridge the gap between classic HTML form elements and Ember's component system. However, as Ember has evolved, using native HTML elements with modifiers has become the preferred approach for several reasons:
- Native HTML elements have better accessibility support
- They provide a more consistent developer experience with standard web development
- They have better performance characteristics
- They avoid the extra abstraction layer that the built-in components provide
This rule helps identify where these built-in form components are being used so they can be replaced with native HTML elements.
Examples of incorrect code for this rule:
import { Input } from '@ember/component';import { Textarea } from '@ember/component';import { Input as EmberInput, Textarea as EmberTextarea } from '@ember/component';Examples of correct code for this rule:
Replace:
With:
Replace:
With: