WebStorm showing warning "Invalid number of arguments, expected 2" when calling Vuex mutation?
I have a call to a Vuex mutation like so:
slideToFrame(framePosition) {
this.setCurrentFrameId(this.currentViewData.scanFramesList[framePosition - 1]);
},
The mutator looks like this:
setCurrentFrameId(state, frameId) {
state.currentFrameId = frameId;
},
WebStorm shows the "Invalid number of arguments, expected 2", but all mutators require `state` as their first parameter and I don't believe this is usually passed explicitly. Am I wrong on this or is there a way that WebStorm can not detect these false positives? It seems like this would be built into the Vue support provided by WebStorm.
Thanks!
请先登录再写评论。
What IDE version do you use? This should have been fixed back in 2020.2, see https://youtrack.jetbrains.com/issue/WEB-25971/Vuex-implement-special-resolve-for-mapped-properties-on-this
Still happening in WebStorm 2024.1.4, unfortunately.
We don't have Typescript set up in the project though, could that be the reason?
Upd: Just to clarify, the mutation/action is added via mapActions/mapMutations.
Do you have a sample project you can share that reproduces the issue?