question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New Octane Rule: `require-tagless-components`

See original GitHub issue

Pulled 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:closed
  • Created 4 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Turbo87commented, Oct 22, 2019

I’m in favor of supporting @tagName mostly because the native class codemod uses it when converting classic to native.

IMHO we should change the codemod then 😉

1reaction
bmishcommented, Oct 19, 2019

Probably want to call this require-tagless-components for consistency with other rule names.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found