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

How to ignore :class.attr #2534

Open
2 tasks done
dahaha-365 opened this issue Aug 26, 2024 · 2 comments
Open
2 tasks done

How to ignore :class.attr #2534

dahaha-365 opened this issue Aug 26, 2024 · 2 comments

Comments

@dahaha-365
Copy link

dahaha-365 commented Aug 26, 2024

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:
  • eslint-plugin-vue version:
  • Vue version:
  • Node version:
  • Operating System:

Please show your full configuration:

import antfu from '@antfu/eslint-config'

export default antfu({
  vue: true,
  unocss: true,
  typescript: true,
  formatters: true,
  ignores: [`.github`, `bin`, `md-cli`, `src/assets`],
}, {
  rules: {
    'semi': [`error`, `never`],
    'quotes': [`error`, `backtick`],
    'no-unused-vars': `off`,
    'no-console': `off`,
    'no-debugger': `off`,
  },
})

What did you do?

      <el-button :class.attr="'emojiTrigger'" size="large" link @click="toggleEmoji">
        😀Emoji键盘
        <el-icon class="ml-2">
          <ElIconArrowDown />
        </el-icon>
      </el-button>

What did you expect to happen?
Don't rewrite this code.
It will compile to:

      <el-button class="emojiTrigger" size="large" link @click="toggleEmoji">
        😀Emoji键盘
        <el-icon class="ml-2">
          <ElIconArrowDown />
        </el-icon>
      </el-button>

It is no inherit parent's class name.

What actually happened?
To:

      <el-button class="emojiTrigger" size="large" link @click="toggleEmoji">
        😀Emoji键盘
        <el-icon class="ml-2">
          <ElIconArrowDown />
        </el-icon>
      </el-button>

Because it match the vue/prefer-separate-static-class rule.

Repository to reproduce this issue

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

No branches or pull requests

3 participants
@dahaha-365 and others