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

vue/object-curly-spacing throws an error for certain objectsInObjects values #1514

Closed
2 tasks done
r-thomson opened this issue Jun 11, 2021 · 1 comment · Fixed by #1515
Closed
2 tasks done

vue/object-curly-spacing throws an error for certain objectsInObjects values #1514

r-thomson opened this issue Jun 11, 2021 · 1 comment · Fixed by #1515
Labels

Comments

@r-thomson
Copy link

Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have read the FAQ and my problem is not listed.

Tell us about your environment

  • ESLint version: 7.28.0
  • eslint-plugin-vue version: 7.11.0
  • Node version: 16.2.0
  • Operating System: macOS 10.15.7

Please show your full configuration:

{
  extends: [
    'plugin:vue/base'
  ],
  rules: {
    'vue/object-curly-spacing': ['error', 'always', {
      objectsInObjects: false
    }]
  }
}

This issue also occurs with this version of the rule as well:

'vue/object-curly-spacing': ['error', 'never', {
  objectsInObjects: true
}]

What did you do?

<template>
  <div v-bind="{ foo: { bar: 'baz' }}">
    Hello World
  </div>
</template>

What did you expect to happen?

The linter should not crash, and no code errors should be reported

What actually happened?

Oops! Something went wrong! :(

ESLint: 7.28.0

TypeError: Cannot read property 'type' of null
Occurred while linting ./Component.vue:1
    at validateBraceSpacing (./node_modules/eslint/lib/rules/object-curly-spacing.js:187:119)
    at checkForObject (./node_modules/eslint/lib/rules/object-curly-spacing.js:237:13)
    at EventEmitter.handlers.<computed> (./node_modules/eslint-plugin-vue/lib/utils/index.js:297:15)
    at EventEmitter.emit (node:events:365:28)
    at NodeEventGenerator.applySelector (./node_modules/vue-eslint-parser/index.js:3577:26)
    at NodeEventGenerator.applySelectors (./node_modules/vue-eslint-parser/index.js:3591:22)
    at NodeEventGenerator.enterNode (./node_modules/vue-eslint-parser/index.js:3599:14)
    at traverse (./node_modules/vue-eslint-parser/index.js:115:13)
    at traverse (./node_modules/vue-eslint-parser/index.js:127:13)
    at traverse (./node_modules/vue-eslint-parser/index.js:127:13)

Repository to reproduce this issue

https://github.com/r-thomson/eslint-plugin-vue-object-curly-spacing-demo

@r-thomson r-thomson changed the title vue/object-no-curly throws an error for certain objectsInObjects values vue/object-curly-spacing throws an error for certain objectsInObjects values Jun 11, 2021
@ota-meshi
Copy link
Member

Thank you for reporting a bug!

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