no-deprecated-scope-attribute.js 821 B

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