no-deprecated-slot-attribute.js 760 B

12345678910111213141516171819202122232425262728
  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. category: undefined,
  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. create (context) {
  23. const templateBodyVisitor = slotAttribute.createTemplateBodyVisitor(context)
  24. return utils.defineTemplateBodyVisitor(context, templateBodyVisitor)
  25. }
  26. }