Skip to content

Rule proposition: no-dupe-keys. #86

Closed
@armano2

Description

@armano2

There is many fields in vue instance/component where we can specify properties visible inside component, data, props, computed, methods.
Invalid Code:

export default {
  props: ['foo'],
  props: {
    foo: String  
  },
  computed: {
    foo () {
    }
  },
  data() {
    return {
      foo: null
    }
  },
  data: {
    foo: null
  },
  methods: {
    foo () {
    }
  }
}

Also there is few reserved names witch should not be overridden by vue instance:

  • properties: $data, $props, $el, $options, $parent, $root, $children, $slots, $scopedSlots, $refs, $isServer, $attrs, $listeners
  • methods: $watch, $set, $delete, $on, $once, $off, $emit, $mount, $forceUpdate, $nextTick, $destroy .....

also user should be able to specify his own reserved names to remove conflicts with used plugins.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions