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

Error on kebab case property #2

Open
J3m5 opened this issue Nov 16, 2023 · 0 comments
Open

Error on kebab case property #2

J3m5 opened this issue Nov 16, 2023 · 0 comments

Comments

@J3m5
Copy link
Owner

J3m5 commented Nov 16, 2023


Error: undefined does not match field "name": string of type Identifier
    at addParam (/home/jeremy/dev/perso/vue-codemod/node_modules/.pnpm/[email protected]_patch_hash=ppjn52lv64cycf3ixwzazcmmi4/node_modules/ast-types/lib/types.js:455:27)
    at /home/jeremy/dev/perso/vue-codemod/node_modules/.pnpm/[email protected]_patch_hash=ppjn52lv64cycf3ixwzazcmmi4/node_modules/ast-types/lib/types.js:478:25
    at Array.forEach (<anonymous>)
    at Function.builder [as identifier] (/home/jeremy/dev/perso/vue-codemod/node_modules/.pnpm/[email protected]_patch_hash=ppjn52lv64cycf3ixwzazcmmi4/node_modules/ast-types/lib/types.js:476:35)
    at buildRef (/home/jeremy/dev/perso/vue-codemod/dist/transformations/composition-api/transformData.js:44:72)
    at NodePath.<anonymous> (/home/jeremy/dev/perso/vue-codemod/dist/transformations/composition-api/transformData.js:61:21)
    at /home/jeremy/dev/perso/vue-codemod/node_modules/.pnpm/[email protected]/node_modules/jscodeshift/src/Collection.js:75:36
    at Array.forEach (<anonymous>)
    at Collection.forEach (/home/jeremy/dev/perso/vue-codemod/node_modules/.pnpm/[email protected]/node_modules/jscodeshift/src/Collection.js:74:18)
    at transformData (/home/jeremy/dev/perso/vue-codemod/dist/transformations/composition-api/transformData.js:51:

<script>
export default {
  name: 'TheGauge',
  props: {
    percent: {
      type: Number,
      required: true,
    },
    backgroundColor: {
      type: String,
      default: '#0d3969',
    },
  },
  computed: {
    gaugeStyles: function () {
      return {
        'background-color': this.backgroundColor, // Bug comes from kebab case property
      }
    },
    innerStyles: function () {
      return {
        width: `${this.percent}%`,
      }
    },
  },
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant