diff --git a/lib/rules/no-dupe-keys.js b/lib/rules/no-dupe-keys.js index 61ffda40e..8b5e8e54c 100644 --- a/lib/rules/no-dupe-keys.js +++ b/lib/rules/no-dupe-keys.js @@ -14,14 +14,7 @@ const utils = require('../utils') // Rule Definition // ------------------------------------------------------------------------------ /** @type {GroupName[]} */ -const GROUP_NAMES = [ - 'props', - 'computed', - 'data', - 'asyncData', - 'methods', - 'setup' -] +const GROUP_NAMES = ['props', 'computed', 'data', 'methods', 'setup'] module.exports = { meta: { diff --git a/tests/lib/rules/no-dupe-keys.js b/tests/lib/rules/no-dupe-keys.js index 9e01f0856..2abae46d0 100644 --- a/tests/lib/rules/no-dupe-keys.js +++ b/tests/lib/rules/no-dupe-keys.js @@ -380,6 +380,24 @@ ruleTester.run('no-dupe-keys', rule, { } } ` + }, + { + // https://github.com/vuejs/eslint-plugin-vue/issues/1687 + filename: 'test.vue', + code: ` + export default { + asyncData() { + return { + foo: 1 + } + }, + data() { + return { + foo: 2 + } + }, + } + ` } ], @@ -709,29 +727,6 @@ ruleTester.run('no-dupe-keys', rule, { } ] }, - { - filename: 'test.vue', - code: ` - export default { - asyncData() { - return { - foo: 1 - } - }, - data() { - return { - foo: 2 - } - }, - } - `, - errors: [ - { - message: "Duplicated key 'foo'.", - line: 10 - } - ] - }, { filename: 'test.js', code: `