You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.4 KiB
56 lines
1.4 KiB
3 years ago
|
/**
|
||
|
* @author Yosuke Ota
|
||
|
* See LICENSE file in root directory for full license.
|
||
|
*/
|
||
|
'use strict'
|
||
|
|
||
|
// ------------------------------------------------------------------------------
|
||
|
// Requirements
|
||
|
// ------------------------------------------------------------------------------
|
||
|
|
||
|
const utils = require('../utils')
|
||
|
|
||
|
// ------------------------------------------------------------------------------
|
||
|
// Rule Definition
|
||
|
// ------------------------------------------------------------------------------
|
||
|
|
||
|
module.exports = {
|
||
|
meta: {
|
||
|
type: 'problem',
|
||
|
docs: {
|
||
|
description:
|
||
|
'disallow using deprecated the `functional` template (in Vue.js 3.0.0+)',
|
||
|
categories: ['vue3-essential'],
|
||
|
url: 'https://eslint.vuejs.org/rules/no-deprecated-functional-template.html'
|
||
|
},
|
||
|
fixable: null,
|
||
|
schema: [],
|
||
|
messages: {
|
||
|
unexpected: 'The `functional` template are deprecated.'
|
||
|
}
|
||
|
},
|
||
|
/**
|
||
|
* @param {RuleContext} context - The rule context.
|
||
|
* @returns {RuleListener} AST event handlers.
|
||
|
*/
|
||
|
create(context) {
|
||
|
return {
|
||
|
Program(program) {
|
||
|
const element = program.templateBody
|
||
|
if (element == null) {
|
||
|
return
|
||
|
}
|
||
|
|
||
|
const functional = utils.getAttribute(element, 'functional')
|
||
|
|
||
|
if (functional) {
|
||
|
context.report({
|
||
|
node: functional,
|
||
|
messageId: 'unexpected'
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|