no-v-text.js 950 B

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * @author tyankatsu <https://github.com/tyankatsu0105>
  3. * See LICENSE file in root directory for full license.
  4. */
  5. 'use strict'
  6. const utils = require('../utils')
  7. // ------------------------------------------------------------------------------
  8. // Rule Definition
  9. // ------------------------------------------------------------------------------
  10. module.exports = {
  11. meta: {
  12. type: 'suggestion',
  13. docs: {
  14. description: 'disallow use of v-text',
  15. categories: undefined,
  16. url: 'https://eslint.vuejs.org/rules/no-v-text.html'
  17. },
  18. fixable: null,
  19. schema: []
  20. },
  21. /** @param {RuleContext} context */
  22. create(context) {
  23. return utils.defineTemplateBodyVisitor(context, {
  24. /** @param {VDirective} node */
  25. "VAttribute[directive=true][key.name.name='text']"(node) {
  26. context.report({
  27. node,
  28. loc: node.loc,
  29. message: "Don't use 'v-text'."
  30. })
  31. }
  32. })
  33. }
  34. }