ember-template-lint
Version:
Linter for Ember or Handlebars templates.
33 lines (28 loc) • 614 B
JavaScript
import Rule from './_base.js';
const message = 'Unexpected {{unbound}} usage.';
export default class NoUnbound extends Rule {
_checkForUnbound(node) {
if (node.path.original === 'unbound') {
this.log({
message,
node,
});
}
}
/**
* @returns {import('./types.js').VisitorReturnType<NoUnbound>}
*/
visitor() {
return {
MustacheStatement(node) {
this._checkForUnbound(node);
},
BlockStatement(node) {
this._checkForUnbound(node);
},
SubExpression(node) {
this._checkForUnbound(node);
},
};
}
}