ember-template-lint
Version:
Linter for Ember or Handlebars templates.
22 lines (19 loc) • 497 B
JavaScript
import Rule from './_base.js';
const ERROR_MESSAGE = 'Only `...attributes` can be applied to elements';
export default class SplatAttributesOnly extends Rule {
/**
* @returns {import('./types.js').VisitorReturnType<SplatAttributesOnly>}
*/
visitor() {
return {
AttrNode(node) {
if (node.name.startsWith('...') && node.name !== '...attributes') {
this.log({
message: ERROR_MESSAGE,
node,
});
}
},
};
}
}