dynamic-directive-arguments.js 637 B

12345678910111213141516171819202122232425
  1. /**
  2. * @author Yosuke Ota
  3. * See LICENSE file in root directory for full license.
  4. */
  5. 'use strict'
  6. module.exports = {
  7. supported: '2.6.0',
  8. createTemplateBodyVisitor (context) {
  9. /**
  10. * Reports dynamic argument node
  11. * @param {VExpressionContainer} dinamicArgument node of dynamic argument
  12. * @returns {void}
  13. */
  14. function reportDynamicArgument (dinamicArgument) {
  15. context.report({
  16. node: dinamicArgument,
  17. messageId: 'forbiddenDynamicDirectiveArguments'
  18. })
  19. }
  20. return {
  21. 'VAttribute[directive=true] > VDirectiveKey > VExpressionContainer': reportDynamicArgument
  22. }
  23. }
  24. }