Disallow certain components, helpers or modifiers from being used.
Use cases include:
- You bring in some addon with helpers or components, but your team deems one or many not suitable and wants to guard against their usage
- You want to discourage use of a deprecated component
Given a config of:
{ "template-no-restricted-invocations": ["foo-bar"] }This rule forbids the following:
This rule allows the following:
One of these:
string[]- helpers or components to disallow (using kebab-case names likenested-scope/component-name)object[]- with the following keys:names-string[]- helpers or components to disallowmessage-string- custom error message to report for violations
// .eslintrc.js
module.exports = {
rules: {
'ember/template-no-restricted-invocations': [
'error',
[
'foo-bar',
{
names: ['deprecated-component'],
message: 'Use new-component instead',
},
],
],
},
};