Skip to content

vue/no-dupe-keys

disallow duplication of field names

  • ⚙️ This rule is included in the following preset configs:
    • *.configs["flat/essential"]
    • *.configs["flat/vue2-essential"]
    • *.configs["flat/strongly-recommended"]
    • *.configs["flat/vue2-strongly-recommended"]
    • *.configs["flat/recommended"]
    • *.configs["flat/vue2-recommended"]
    • "plugin:vue/essential"
    • "plugin:vue/vue2-essential"
    • "plugin:vue/strongly-recommended"
    • "plugin:vue/vue2-strongly-recommended"
    • "plugin:vue/recommended"
    • "plugin:vue/vue2-recommended"

This rule prevents using duplicate key names.

📖 Rule Details

This rule prevents duplicate props/data/methods/etc. key names defined on a component. Even if a key name does not conflict in the <script> tag itself, it still may lead to a conflict in the <template> since Vue allows directly accessing these keys from there.

Now loading...

🔧 Options

json
{
  "vue/no-dupe-keys": ["error", {
    "groups": []
  }]
}
  • "groups" (string[]) Array of additional groups to search for duplicates. Default is empty.

"groups": ["firebase"]

Now loading...

🚀 Version

This rule was introduced in eslint-plugin-vue v3.9.0

🔍 Implementation