Skip to content
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

Duplicate props show Duplicate Identifier error in wrong place #2459

Open
1 task done
andrewisaburden opened this issue Nov 11, 2020 · 2 comments
Open
1 task done

Comments

@andrewisaburden
Copy link
Contributor

  • I have searched through existing issues

Info

  • Vetur version: 0.30.0
  • VS Code version: any

Problem

Duplicate props don't show errors in the correct file, with correct line numbers.

Reproducible Case

Breaking test is to modify class-child.vue:

<script>
import { Vue, Component, Prop, PropSync, Model } from 'vue-property-decorator'

@Component({
  props: { foo: Number }
})
export default class Child extends Vue {
  @Prop(Number) bar
  @Prop({ default: 'car' }) car
  @Prop({ required: false }) dar
  @Prop({ required: true }) ear
  @Prop() ear
  @Prop([String, Number]) far
  @PropSync('name', { type: String }) syncedName

  @Model('change', { required: true }) checked
}
</script>

By adding @Prop() ear we now have duplicated the ear prop.

Expected result is to see both lines defining the ear prop to be errored, and for the class-child.vue file to be the source of the error.

Actual result is to see

Duplicate identifier 'ear'.Vetur(2300)
Duplicate identifier 'ear'.Vetur(2300)

in parent.vue with 0,0 as line number, character.

@yoyo930021
Copy link
Member

If you can provide a project, we can study more easily.

@andrewisaburden
Copy link
Contributor Author

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

No branches or pull requests

2 participants