Skip to content

Simple prop declaration replaces "" with nothing when auto-fixing #993

Closed
@carestad

Description

@carestad

Tell us about your environment

  • ESLint version: v6.7.1
  • eslint-plugin-vue version: v6.0.1
  • Node version: v12.13.0

Please show your full configuration:

{
    "extends": [
        "eslint:recommended",
        "plugin:vue/recommended"
    ],
    "plugins": [
        "vue"
    ]
}

What did you do?

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

<script>
export default {
  name: 'Test',
  props: {
    foo: "",
  },
};
</script>

Running eslint test.vue gives me the following:

image

And then after running eslint --fix test.vue

image

What did you expect to happen?

Not sure what I expected, but did not expect it to just replace "" with nothing, leaving the JS invalid.

What actually happened?

{
  props: {
    foo: "",
  }
}

was turned into

{
  props: {
    foo: ,
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions