Skip to content

vue/setup-props-no-reactivity-loss: false negative inside ternary operator #2352

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
2 tasks done
FloEdelmann opened this issue Dec 18, 2023 · 0 comments · Fixed by #2394
Closed
2 tasks done

vue/setup-props-no-reactivity-loss: false negative inside ternary operator #2352

FloEdelmann opened this issue Dec 18, 2023 · 0 comments · Fixed by #2394

Comments

@FloEdelmann
Copy link
Member

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: 8.56.0
  • eslint-plugin-vue version: 9.19.2
  • Node version: 18
  • Operating System: Ubuntu

Please show your full configuration:

{
  "rules": {
    "vue/setup-props-no-reactivity-loss": "error"
  }
}

What did you do?

export default defineComponent({
  setup(props) {
    const correct = props.foo;
    const incorrect = props.foo ? bar : undefined;
  },
});

What did you expect to happen?
Two errors being reported by vue/no-setup-props-reactivity-loss.html, one for each line.

What actually happened?
Only the first line is being reported.

Repository to reproduce this issue
https://ota-meshi.github.io/eslint-plugin-vue-demo/#eJxtj8EKwjAMhl8l9KLC5sDjnHrwNXaZXQaFmZQ0Hcrou1uqBxEvIcn/JfmzGssjmtZ0wYrzeu7J3T2LwgojTo7wyrkmJIUEk/AdNkvEzbEnfBQuU0Oc9Zferj0BBNTot17Yhx2UDoBlCpqjCFqFExR1PzEfv3VHfwi4wG0QaCHS+9xYZlLVU9rltGs+X5jKSJwxmHY12W5DXBcrdVlVCw5W3eL0Wc8cMnVI6QWPvV6Q

@FloEdelmann FloEdelmann changed the title vue/setup-props-no-reactivity-loss: false negative when inside ternary vue/setup-props-no-reactivity-loss: false negative inside ternary operator Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant