版博士V2.0程序
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1 год назад
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. module.exports = {
  8. supported: '>=2.7.0',
  9. /** @param {RuleContext} context @returns {TemplateListener} */
  10. createScriptVisitor(context) {
  11. const scriptSetup = utils.getScriptSetupElement(context)
  12. if (!scriptSetup) {
  13. return {}
  14. }
  15. const reportNode =
  16. utils.getAttribute(scriptSetup, 'setup') || scriptSetup.startTag
  17. return {
  18. Program() {
  19. context.report({
  20. node: reportNode,
  21. messageId: 'forbiddenScriptSetup'
  22. })
  23. }
  24. }
  25. }
  26. }