Skip to content

Commit

Permalink
Allow asyncData in vue/no-dupe-keys (#1735)
Browse files Browse the repository at this point in the history
  • Loading branch information
FloEdelmann committed Dec 3, 2021
1 parent 10dd1a9 commit 622ac26
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 31 deletions.
9 changes: 1 addition & 8 deletions lib/rules/no-dupe-keys.js
Expand Up @@ -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: {
Expand Down
41 changes: 18 additions & 23 deletions tests/lib/rules/no-dupe-keys.js
Expand Up @@ -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
}
},
}
`
}
],

Expand Down Expand Up @@ -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: `
Expand Down

0 comments on commit 622ac26

Please sign in to comment.