Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sqal opened this issue Jan 1, 2018 · 1 comment
Closed

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

sqal opened this issue Jan 1, 2018 · 1 comment
Assignees
Labels

Comments

@sqal
Copy link

sqal commented Jan 1, 2018

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)
@michalsnik michalsnik added the bug label Jan 1, 2018
@michalsnik
Copy link
Member

Thank you @sqal for posting this issue! It should indeed not throw an error. We'll fix it soon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants