no-deprecated-slot-scope-attribute.js 886 B

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * @author Yosuke Ota
  3. * See LICENSE file in root directory for full license.
  4. */
  5. 'use strict'
  6. const utils = require('../utils')
  7. const slotScopeAttribute = require('./syntaxes/slot-scope-attribute')
  8. module.exports = {
  9. meta: {
  10. type: 'suggestion',
  11. docs: {
  12. description:
  13. 'disallow deprecated `slot-scope` attribute (in Vue.js 2.6.0+)',
  14. categories: ['vue3-essential'],
  15. url: 'https://eslint.vuejs.org/rules/no-deprecated-slot-scope-attribute.html'
  16. },
  17. fixable: 'code',
  18. schema: [],
  19. messages: {
  20. forbiddenSlotScopeAttribute: '`slot-scope` are deprecated.'
  21. }
  22. },
  23. /** @param {RuleContext} context */
  24. create(context) {
  25. const templateBodyVisitor = slotScopeAttribute.createTemplateBodyVisitor(
  26. context,
  27. { fixToUpgrade: true }
  28. )
  29. return utils.defineTemplateBodyVisitor(context, templateBodyVisitor)
  30. }
  31. }