File tree Expand file tree Collapse file tree 2 files changed +918
-190
lines changed Expand file tree Collapse file tree 2 files changed +918
-190
lines changed Original file line number Diff line number Diff line change @@ -496,12 +496,16 @@ module.exports = {
496
496
let groupName = null
497
497
if ( / ^ m a p M u t a t i o n s | m a p A c t i o n s $ / u. test ( node . callee . name ) ) {
498
498
groupName = 'methods'
499
- } else if ( / ^ m a p S t a t e | m a p G e t t e r s $ / u. test ( node . callee . name ) ) {
499
+ } else if (
500
+ / ^ m a p S t a t e | m a p G e t t e r s | m a p W r i t a b l e S t a t e $ / u. test ( node . callee . name )
501
+ ) {
500
502
groupName = 'computed'
501
503
}
502
504
503
505
if ( ! groupName || node . arguments . length === 0 ) return
504
- const arg = node . arguments [ 0 ]
506
+ // On Pinia the store is always the first argument
507
+ const arg =
508
+ node . arguments . length === 2 ? node . arguments [ 1 ] : node . arguments [ 0 ]
505
509
if ( arg . type === 'ObjectExpression' ) {
506
510
// e.g.
507
511
// `mapMutations({ add: 'increment' })`
You can’t perform that action at this time.
0 commit comments