mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-27 01:47:46 +00:00
chore: update frontend build for v1.1.82 [skip ci]
This commit is contained in:
82
web/admin-spa/node_modules/eslint-plugin-vue/lib/rules/max-template-depth.js
generated
vendored
82
web/admin-spa/node_modules/eslint-plugin-vue/lib/rules/max-template-depth.js
generated
vendored
@@ -1,82 +0,0 @@
|
||||
/**
|
||||
* @author kevsommer Kevin Sommer
|
||||
* See LICENSE file in root directory for full license.
|
||||
*/
|
||||
'use strict'
|
||||
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: 'problem',
|
||||
docs: {
|
||||
description: 'enforce maximum depth of template',
|
||||
categories: undefined,
|
||||
url: 'https://eslint.vuejs.org/rules/max-template-depth.html'
|
||||
},
|
||||
fixable: null,
|
||||
schema: [
|
||||
{
|
||||
type: 'object',
|
||||
properties: {
|
||||
maxDepth: {
|
||||
type: 'integer',
|
||||
minimum: 1
|
||||
}
|
||||
},
|
||||
additionalProperties: false,
|
||||
minProperties: 1
|
||||
}
|
||||
],
|
||||
messages: {
|
||||
templateTooDeep:
|
||||
'Element is nested too deeply (depth of {{depth}}, maximum allowed is {{limit}}).'
|
||||
}
|
||||
},
|
||||
/** @param {RuleContext} context */
|
||||
create(context) {
|
||||
const option = context.options[0] || {}
|
||||
|
||||
/**
|
||||
* @param {VElement} element
|
||||
* @param {number} curDepth
|
||||
*/
|
||||
function checkMaxDepth(element, curDepth) {
|
||||
if (curDepth > option.maxDepth) {
|
||||
context.report({
|
||||
node: element,
|
||||
messageId: 'templateTooDeep',
|
||||
data: {
|
||||
depth: curDepth,
|
||||
limit: option.maxDepth
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (!element.children) {
|
||||
return
|
||||
}
|
||||
|
||||
for (const child of element.children) {
|
||||
if (child.type === 'VElement') {
|
||||
checkMaxDepth(child, curDepth + 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
/** @param {Program} program */
|
||||
Program(program) {
|
||||
const element = program.templateBody
|
||||
|
||||
if (element == null) {
|
||||
return
|
||||
}
|
||||
|
||||
if (element.type !== 'VElement') {
|
||||
return
|
||||
}
|
||||
|
||||
checkMaxDepth(element, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user