Skip to content

Latest commit

 

History

History
54 lines (42 loc) · 804 Bytes

no-reservered-keys.md

File metadata and controls

54 lines (42 loc) · 804 Bytes

Prevent overwrite reserved keys (no-reservered-keys)

This rule prevents to use reserved names from to avoid conflicts and unexpected behavior.

Rule Details

👎 Examples of incorrect code for this rule:

export default {
  props: {
    $el: String
  },
  computed: {
    $on: {
      get () {
      }
    }
  },
  data: {
    _foo: null
  },
  methods: {
    $nextTick () {
    }
  }
}

🔧 Options

This rule has an object option:

"reserved": [] (default) array of dissalowed names inside groups.

"groups": [] (default) array of additional groups to search for duplicates.

Example:

vue/no-dupe-keys: [2, {
  reserved: ['foo']
}]

👎 Examples of incorrect code for this configuration

export default {
  computed: {
    foo () {}
  }
}