Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 6 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /