💼 This rule is enabled in the 📋 template-lint-migration config.
🔧 This rule is automatically fixable by the --fix CLI option.
HBS Only: This rule applies to classic
.hbstemplate files only (loose mode). It is not relevant forgjs/gtsfiles (strict mode), where these patterns cannot occur.
Disallows curly component invocation syntax. Use angle bracket syntax instead.
There are two ways to invoke a component in a template: curly component syntax
({{my-component}}), and angle bracket syntax (<MyComponent />). The
difference between them is syntactical. You should favour angle bracket syntax
as it improves readability of templates, i.e. disambiguates components from
helpers, and is also the future direction Ember is going with the Octane
Edition.
This rule checks all the curly braces in your app and warns about those that look like they could be component invocations.
This rule forbids the following:
This rule allows the following:
This rule accepts an options object with the following properties:
allow(default:[]) - Array of component names to allow in curly syntaxdisallow(default:[]) - Array of component names to disallow in curly syntaxrequireDash(default:false) - Require dashes in component namesnoImplicitThis(default:true) - Don't allow implicitthisreferences
// .eslintrc.js
module.exports = {
rules: {
'ember/template-no-curly-component-invocation': [
'error',
{
allow: ['some-helper'],
disallow: [],
},
],
},
};