WebStorm showing warning "Invalid number of arguments, expected 2" when calling Vuex mutation? Follow
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!
Please sign in to leave a comment.
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