From df11a8eef4f8898f5b44da52c682f5c1b61ed615 Mon Sep 17 00:00:00 2001 From: Armano Date: Sun, 6 Aug 2017 22:31:48 +0200 Subject: [PATCH 1/2] Treat Vue.mixin as components --- lib/utils/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/index.js b/lib/utils/index.js index b2a5bacbf..961621aa2 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -381,7 +381,7 @@ module.exports = { callee.object.type === 'Identifier' && callee.object.name === 'Vue' && callee.property.type === 'Identifier' && - callee.property.name === 'component' && + (callee.property.name === 'component' || callee.property.name === 'mixin') && node.arguments.length && node.arguments.slice(-1)[0].type === 'ObjectExpression' From fdf0219830d78d37280dd56dc5d9c698634bd43c Mon Sep 17 00:00:00 2001 From: Armano Date: Tue, 8 Aug 2017 17:18:24 +0200 Subject: [PATCH 2/2] Add unit test for `Vue.mixin` --- tests/lib/utils/vue-component.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/lib/utils/vue-component.js b/tests/lib/utils/vue-component.js index 38b696333..0dd2d0cf3 100644 --- a/tests/lib/utils/vue-component.js +++ b/tests/lib/utils/vue-component.js @@ -120,6 +120,12 @@ function invalidTests (ext) { parserOptions, errors: [makeError(1)] }, + { + filename: `test.${ext}`, + code: `Vue.mixin({})`, + parserOptions, + errors: [makeError(1)] + }, { filename: `test.${ext}`, code: `