Open ylc395 opened 2 months ago
I can commit a PR if this feature request is acceptable.
I actually don't think that an option is required; this should be the rule's default behavior.
All call expressions that are not used in return statements, variable assignments or function parameters are probably side effects and thus should be reported. PR is welcome for that!
What rule do you want to change? vue/no-side-effects-in-computed-properties
Does this change cause the rule to produce more or fewer warnings? More warnings
How will the change be implemented? (New option, new default behavior, etc.)? Add a option to this rule, for example:
{ noFloatingCall: true }
Please provide some example code that this change will affect: Examples from here: https://github.com/vuejs/eslint-plugin-vue/issues/97
and composition-api:
What does the rule currently do for this code? Do nothing.
What will the rule do after it's changed? Report a side-effect-in-computed warning.
Additional context https://github.com/vuejs/eslint-plugin-vue/issues/58#issuecomment-311921206 https://github.com/vuejs/eslint-plugin-vue/issues/97