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/no-ref-as-operand should not autofix when variable is Ref | NotARef #1980

Closed
2 tasks done
jacekkarczmarczyk opened this issue Sep 17, 2022 · 2 comments · Fixed by #1988
Closed
2 tasks done

vue/no-ref-as-operand should not autofix when variable is Ref | NotARef #1980

jacekkarczmarczyk opened this issue Sep 17, 2022 · 2 comments · Fixed by #1988

Comments

@jacekkarczmarczyk
Copy link

jacekkarczmarczyk commented Sep 17, 2022

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.23.1
  • eslint-plugin-vue version: 9.5.1
  • Node version: 16.14.2
  • Operating System: win

Please show your full configuration:

module.exports = {
  extends: ['jkarczm/vuetify'],
  parserOptions: {
    project: 'tsconfig.json',
  },
}

(where jkarczm/vuetify is from https://github.com/jacekkarczmarczyk/eslint-config-jkarczm package, but probably including only vue/no-ref-as-operand matters)

What did you do?

let foo: Ref<number> | undefined;

if (!foo) {
  foo = ref(5);
}

What did you expect to happen?

no error, no autofixing

What actually happened?

code was "fixed" to

let foo: Ref<number> | undefined;

if (!foo.value) {
  foo.value = ref(5);
}
@ylavoie
Copy link

ylavoie commented Sep 19, 2022

let foo;
foo = Reactive(bar)

triggers the same bug.

@Tofandel
Copy link

Tofandel commented Sep 22, 2022

This was caused by #1965 I think, because those cases didn't trigger an error before and they now do

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

Successfully merging a pull request may close this issue.

3 participants