eslint-plugin-vue
Advanced tools
Comparing version 6.1.0 to 6.1.1
@@ -76,17 +76,11 @@ /** | ||
return Object.assign({}, | ||
{ | ||
"CallExpression > MemberExpression > Identifier[name='component']" (node) { | ||
const parent = node.parent.parent | ||
const calleeObject = utils.unwrapTypes(parent.callee.object) | ||
utils.executeOnCallVueComponent(context, (node) => { | ||
if (node.arguments.length === 2) { | ||
const argument = node.arguments[0] | ||
if (calleeObject.type === 'Identifier' && calleeObject.name === 'Vue') { | ||
if (parent.arguments && parent.arguments.length === 2) { | ||
const argument = parent.arguments[0] | ||
if (canConvert(argument)) { | ||
convertName(argument) | ||
} | ||
} | ||
if (canConvert(argument)) { | ||
convertName(argument) | ||
} | ||
} | ||
}, | ||
}), | ||
utils.executeOnVue(context, (obj) => { | ||
@@ -93,0 +87,0 @@ const node = obj.properties |
@@ -104,17 +104,11 @@ /** | ||
return Object.assign({}, | ||
{ | ||
"CallExpression > MemberExpression > Identifier[name='component']" (node) { | ||
const parent = node.parent.parent | ||
const calleeObject = utils.unwrapTypes(parent.callee.object) | ||
utils.executeOnCallVueComponent(context, (node) => { | ||
if (node.arguments.length === 2) { | ||
const argument = node.arguments[0] | ||
if (calleeObject.type === 'Identifier' && calleeObject.name === 'Vue') { | ||
if (parent.arguments && parent.arguments.length === 2) { | ||
const argument = parent.arguments[0] | ||
if (canVerify(argument)) { | ||
verifyName(argument) | ||
} | ||
} | ||
if (canVerify(argument)) { | ||
verifyName(argument) | ||
} | ||
} | ||
}, | ||
}), | ||
utils.executeOnVue(context, (object) => { | ||
@@ -121,0 +115,0 @@ const node = object.properties |
@@ -89,20 +89,11 @@ /** | ||
return Object.assign({}, | ||
{ | ||
"CallExpression > MemberExpression > Identifier[name='component']" (node) { | ||
const parent = node.parent.parent | ||
const calleeObject = utils.unwrapTypes(parent.callee.object) | ||
utils.executeOnCallVueComponent(context, (node) => { | ||
if (node.arguments.length === 2) { | ||
const argument = node.arguments[0] | ||
if (calleeObject.type === 'Identifier' && | ||
calleeObject.name === 'Vue' && | ||
parent.arguments && | ||
parent.arguments.length === 2 | ||
) { | ||
const argument = parent.arguments[0] | ||
if (canVerify(argument)) { | ||
reportIfInvalid(argument) | ||
} | ||
if (canVerify(argument)) { | ||
reportIfInvalid(argument) | ||
} | ||
} | ||
}, | ||
}), | ||
utils.executeOnVue(context, (obj) => { | ||
@@ -109,0 +100,0 @@ // Report if a component has been registered locally with a reserved name. |
@@ -639,2 +639,26 @@ /** | ||
/** | ||
* Check call `Vue.component` and call callback. | ||
* @param {RuleContext} _context The ESLint rule context object. | ||
* @param {Function} cb Callback function | ||
*/ | ||
executeOnCallVueComponent (_context, cb) { | ||
return { | ||
"CallExpression > MemberExpression > Identifier[name='component']": (node) => { | ||
const callExpr = node.parent.parent | ||
const callee = callExpr.callee | ||
if (callee.type === 'MemberExpression') { | ||
const calleeObject = this.unwrapTypes(callee.object) | ||
if (calleeObject.type === 'Identifier' && | ||
calleeObject.name === 'Vue' && | ||
callee.property === node && | ||
callExpr.arguments.length >= 1) { | ||
cb(callExpr) | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
/** | ||
* Return generator with all properties | ||
@@ -641,0 +665,0 @@ * @param {ASTNode} node Node to check |
{ | ||
"name": "eslint-plugin-vue", | ||
"version": "6.1.0", | ||
"version": "6.1.1", | ||
"description": "Official ESLint plugin for Vue.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10722
387049