New Octane Rule: `require-tagless-components`
See original GitHub issuePulled from https://github.com/ember-cli/eslint-plugin-ember/issues/533 which proposes a new set of rules for Octane related best practices
Only allow @glimmer/component
base class, or tagName: ‘’ if @ember/component
is used
// ### Good
import Component from '@glimmer/component'
export default class MyComponent extends Component {
...
}
import Component from '@ember/component'
export default class MyComponent extends Component {
tagName = '';
}
import Component from '@ember/component'
export default Component.extend({
tagName: ''
});
// ### Bad
// implicit `<div>`
import Component from '@ember/component'
export default class MyComponent extends Component {
...
}
import Component from '@ember/component'
export default Component.extend({
...
});
// custom tag
import Component from '@ember/component'
export default class MyComponent extends Component {
tagName = 'span';
}
import Component from '@ember/component'
export default Component.extend({
tagName: 'span'
});
If anyone would like to implement this please comment that you’ll take it and work away.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
eslint-plugin-ember | Yarn - Package Manager
NPM version NPM downloads CI. An ESLint plugin that provides a set of rules for Ember applications based on commonly known good practices....
Read more >eslint-plugin-ember - npm
An ESLint plugin that provides a set of rules for Ember applications ... require-tagless-components, disallow using the wrapper element of a ...
Read more >eslint-plugin-ember/README.md - UNPKG
> An ESlint plugin that provides set of rules for Ember Applications based on commonly known good practices. 8. 9, ## ❗️Requirements.
Read more >Question about the Native Decorator Support feature - Ember.JS
I'm working on the next video in EmberMap's free What's New in Ember series ... required an intermediate phase between classic and octane...
Read more >eslint-plugin-ember - npm Package Health Analysis - Snyk
Latest version published 18 days ago. License: MIT ... fromPairs( Object.keys( require('eslint-plugin-ember').configs.recommended.rules ).map(k => [k, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
IMHO we should change the codemod then 😉
Probably want to call this
require-tagless-components
for consistency with other rule names.