We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
vue/no-unused-properties
1 parent 52e0770 commit a4be0fcCopy full SHA for a4be0fc
lib/rules/no-unused-properties.js
@@ -496,12 +496,16 @@ module.exports = {
496
let groupName = null
497
if (/^mapMutations|mapActions$/u.test(node.callee.name)) {
498
groupName = 'methods'
499
- } else if (/^mapState|mapGetters$/u.test(node.callee.name)) {
+ } else if (
500
+ /^mapState|mapGetters|mapWritableState$/u.test(node.callee.name)
501
+ ) {
502
groupName = 'computed'
503
}
504
505
if (!groupName || node.arguments.length === 0) return
- 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]
509
if (arg.type === 'ObjectExpression') {
510
// e.g.
511
// `mapMutations({ add: 'increment' })`
0 commit comments