Skip to content

False positive in rule "vue/require-prop-types" #315

Closed
@sqal

Description

@sqal

Tell us about your environment

  • ESLint Version: 4.14.0
  • eslint-plugin-vue Version: 4.0.0
  • Node Version: 8.5.0

Please show your full configuration:

// basic configuration
module.exports = {
  root: true,
  extends: [
    'airbnb-base',
    'plugin:vue/recommended',
  ],
  parserOptions: {
    parser: 'babel-eslint'
  },
  plugins: ['vue']
}

What did you do? Please include the actual source code causing the issue.

import props from './Foo.props';

// @vue/component
export default {
  name: 'Foo',
  props,
  render: h => h('div', 'foo'),
};

What did you expect to happen?
Should not raise require-prop-types error

What actually happened? Please include the actual, raw output from ESLint.
Setting props in a component that are defined outside of it raises the error:

C:\dev\foobar\src\app.js
  6:3   error  Props should at least define their types vue/require-prop-types

✖ 1 problem (1 error, 0 warnings)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions