Skip to content

vue/require-valid-default-prop fails to report error on type mismatch #1044

Closed
@jantajov

Description

@jantajov

Given following single file Vue.js component:

<template>
  <div>Hello</div>
</template>

<script>
  export default {
    name: 'AppHello',
    props: {
      textProp: {type: String, default: () => 1233}
    }
  }
</script>

I would expect to get vue/require-valid-default-prop error as the prop does not have valid default value. Types does not match.

Howsoever, no such error is thrown during linting.

I am not sure if this is intended. But if it is, at least the docs should be updated.

Versions:

vue/cli-plugin-eslint is ^3.11.0"
eslint is ^5.16.0
node is ^10.16.0

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