Skip to content

Commit becfb8a

Browse files
armano2michalsnik
authored andcommitted
Treat Vue.mixin as components (#137)
* Treat Vue.mixin as components * Add unit test for `Vue.mixin`
1 parent 85558dc commit becfb8a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/utils/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ module.exports = {
382382
callee.object.type === 'Identifier' &&
383383
callee.object.name === 'Vue' &&
384384
callee.property.type === 'Identifier' &&
385-
callee.property.name === 'component' &&
385+
(callee.property.name === 'component' || callee.property.name === 'mixin') &&
386386
node.arguments.length &&
387387
node.arguments.slice(-1)[0].type === 'ObjectExpression'
388388

tests/lib/utils/vue-component.js

+6
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ function invalidTests (ext) {
120120
parserOptions,
121121
errors: [makeError(1)]
122122
},
123+
{
124+
filename: `test.${ext}`,
125+
code: `Vue.mixin({})`,
126+
parserOptions,
127+
errors: [makeError(1)]
128+
},
123129
{
124130
filename: `test.${ext}`,
125131
code: `

0 commit comments

Comments
 (0)