no-deprecated-slot-attribute.js 808 B

1234567891011121314151617181920212223242526272829
  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 slotAttribute = require('./syntaxes/slot-attribute')
  8. module.exports = {
  9. meta: {
  10. type: 'suggestion',
  11. docs: {
  12. description: 'disallow deprecated `slot` attribute (in Vue.js 2.6.0+)',
  13. categories: ['vue3-essential'],
  14. url: 'https://eslint.vuejs.org/rules/no-deprecated-slot-attribute.html'
  15. },
  16. fixable: 'code',
  17. schema: [],
  18. messages: {
  19. forbiddenSlotAttribute: '`slot` attributes are deprecated.'
  20. }
  21. },
  22. /** @param {RuleContext} context */
  23. create(context) {
  24. const templateBodyVisitor = slotAttribute.createTemplateBodyVisitor(context)
  25. return utils.defineTemplateBodyVisitor(context, templateBodyVisitor)
  26. }
  27. }