no-deprecated-inline-template.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * @author Yosuke Ota
  3. * See LICENSE file in root directory for full license.
  4. */
  5. 'use strict'
  6. // ------------------------------------------------------------------------------
  7. // Requirements
  8. // ------------------------------------------------------------------------------
  9. const utils = require('../utils')
  10. // ------------------------------------------------------------------------------
  11. // Rule Definition
  12. // ------------------------------------------------------------------------------
  13. module.exports = {
  14. meta: {
  15. type: 'problem',
  16. docs: {
  17. description:
  18. 'disallow using deprecated `inline-template` attribute (in Vue.js 3.0.0+)',
  19. categories: ['vue3-essential'],
  20. url: 'https://eslint.vuejs.org/rules/no-deprecated-inline-template.html'
  21. },
  22. fixable: null,
  23. schema: [],
  24. messages: {
  25. unexpected: '`inline-template` are deprecated.'
  26. }
  27. },
  28. /** @param {RuleContext} context */
  29. create(context) {
  30. return utils.defineTemplateBodyVisitor(context, {
  31. /** @param {VIdentifier} node */
  32. "VAttribute[directive=false] > VIdentifier[rawName='inline-template']"(
  33. node
  34. ) {
  35. context.report({
  36. node,
  37. loc: node.loc,
  38. messageId: 'unexpected'
  39. })
  40. }
  41. })
  42. }
  43. }