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

no-ref-as-operand fails to trigger depending on boolean operator order #2599

Closed
2 tasks done
tiagoroldao opened this issue Nov 6, 2024 · 1 comment
Closed
2 tasks done

Comments

@tiagoroldao
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.32.0
  • eslint-plugin-vue version: 9.30.0
  • Vue version: 2.7.16
  • Node version: 18
  • Operating System: macos

Please show your full configuration:

module.exports = {
  root: true,
  env: {
    node: true,
  },
  extends: ['plugin:vue/essential', '@vue/typescript', '@vue/prettier',],
  rules: {
    'no-console': 'warn',
    'no-debugger': 'warn',
    'no-unused-vars': 'off',
    '@typescript-eslint/no-unused-vars': [
      'warn',
      {
        argsIgnorePattern: '^_',
        caughtErrorsIgnorePattern: '^_',
        destructuredArrayIgnorePattern: '^_',
        varsIgnorePattern: '^_',
        ignoreRestSiblings: true,
      },
    ],
    'spaced-comment': ['warn', 'always'],
    'vue/valid-v-slot': [
      'error',
      {
        allowModifiers: true,
      },
    ],
    'vue/no-ref-as-operand': 'warn',
    'vue/component-name-in-template-casing': ['error', 'PascalCase', { registeredComponentsOnly: false }],
    'vue/custom-event-name-casing': ['error', 'kebab-case'],
    'vue/padding-line-between-blocks': ['error', 'always'],
  },
  parserOptions: {
    parser: '@typescript-eslint/parser',
  },
};

What did you do?

// `isUpdating` is a ComputedRef

function onValidationChanged() {
  config.value.steps.forEach((step, index) => {
    if (index <= stepIndex.value || isUpdating) {
      step.state = validations.value[index]?.$invalid ? 'invalid' : 'valid';
    }
  });
}

What did you expect to happen?
vue/no-ref-as-operand to be trigered on isUpdating

What actually happened?

No error is found. It is found if the order is reversed, though. Below are IDE snapshots for clarity, but this happens when running eslint via CLI on the file too:

Screenshot 2024-11-06 at 13 16 55
Screenshot 2024-11-06 at 13 16 40

Repository to reproduce this issue

Can provide one if requested.

@FloEdelmann
Copy link
Member

Duplicate of #2271

@FloEdelmann FloEdelmann marked this as a duplicate of #2271 Nov 6, 2024
@FloEdelmann FloEdelmann closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants