Movatterモバイル変換


[0]ホーム

URL:


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

Commit33ae281

Browse files
committed
fix: do not blindless removeVue.use statements
Fixes#28Note: the end result is still not valid Vue 3 code. But at least itdoesn't introduce unintended changes.
1 parentbbe310c commit33ae281

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

‎generator/codemods/global-api/remove-vue-use.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,18 @@ module.exports = function removeVueUse({ j, root }) {
2222
}
2323
}
2424
})
25-
vueUseCalls.remove()
25+
26+
constremovablePlugins=['VueRouter','Vuex']
27+
constremovableUseCalls=vueUseCalls.filter(({ node})=>{
28+
if(j.Identifier.check(node.arguments[0])){
29+
constplugin=node.arguments[0].name
30+
if(removablePlugins.includes(plugin)){
31+
returntrue
32+
}
33+
}
34+
35+
returnfalse
36+
})
37+
38+
removableUseCalls.remove()
2639
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp