first commit
This commit is contained in:
29
app_vue/node_modules/eslint-plugin-vue/lib/rules/no-constant-condition.js
generated
vendored
Normal file
29
app_vue/node_modules/eslint-plugin-vue/lib/rules/no-constant-condition.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* @author Flo Edelmann
|
||||
*/
|
||||
'use strict'
|
||||
|
||||
const { wrapCoreRule } = require('../utils')
|
||||
|
||||
const conditionalDirectiveNames = new Set(['v-show', 'v-if', 'v-else-if'])
|
||||
|
||||
// eslint-disable-next-line no-invalid-meta, no-invalid-meta-docs-categories
|
||||
module.exports = wrapCoreRule('no-constant-condition', {
|
||||
create(_context, { coreHandlers }) {
|
||||
return {
|
||||
VDirectiveKey(node) {
|
||||
if (
|
||||
conditionalDirectiveNames.has(`v-${node.name.name}`) &&
|
||||
node.parent.value &&
|
||||
node.parent.value.expression &&
|
||||
coreHandlers.IfStatement
|
||||
) {
|
||||
coreHandlers.IfStatement({
|
||||
// @ts-expect-error -- Process expression of VExpressionContainer as IfStatement.
|
||||
test: node.parent.value.expression
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user