Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 769 Bytes

require-prop-types.md

File metadata and controls

39 lines (28 loc) · 769 Bytes

require type definitions in props (vue/require-prop-types)

  • ⚙️ This rule is included in "plugin:vue/strongly-recommended" and "plugin:vue/recommended".

In committed code, prop definitions should always be as detailed as possible, specifying at least type(s).

📖 Rule Details

This rule enforces that a props statement contains type definition.

👎 Examples of incorrect code for this rule:

props: ['status']

👍 Examples of correct code for this rule:

props: {
  status: String
}
props: {
  status: {
    type: String,
    required: true,
    validate: function (value) {
      return ['syncing', 'synced', 'version-conflict', 'error'].indexOf(value) !== -1
    }
  }
}

🔧 Options

Nothing.