diff --git a/lib/rules/no-unused-properties.js b/lib/rules/no-unused-properties.js index 4c9c0e418..39c6a8267 100644 --- a/lib/rules/no-unused-properties.js +++ b/lib/rules/no-unused-properties.js @@ -433,7 +433,11 @@ module.exports = { node, new Set([GROUP_WATCHER]) )) { - watcherNames.add(watcher.name) + let path + for (const seg of watcher.name.split('.')) { + path = path ? `${path}.${seg}` : seg + watcherNames.add(path) + } } for (const prop of utils.iterateProperties(node, groups)) { if (watcherNames.has(prop.name)) { diff --git a/tests/lib/rules/no-unused-properties.js b/tests/lib/rules/no-unused-properties.js index b9f984afc..7c37da2f8 100644 --- a/tests/lib/rules/no-unused-properties.js +++ b/tests/lib/rules/no-unused-properties.js @@ -248,6 +248,21 @@ tester.run('no-unused-properties', rule, { `, options: allOptions }, + { + filename: 'test.vue', + code: ` + + ` + }, // data used as a template identifier {