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/attributes-order fails with binded and unbinded prop #1053

Closed
jacekkarczmarczyk opened this issue Feb 17, 2020 · 2 comments · Fixed by #1055
Closed

vue/attributes-order fails with binded and unbinded prop #1053

jacekkarczmarczyk opened this issue Feb 17, 2020 · 2 comments · Fixed by #1055
Labels

Comments

@jacekkarczmarczyk
Copy link

Tell us about your environment

  • ESLint version: 6.8.0
  • eslint-plugin-vue version: 6.2.0
  • Node version: 12.10.0

Please show your full configuration:

module.exports = {
  root: true,
  env: {
    node: true,
    jest: true,
  },
  plugins: [
    '@typescript-eslint',
    'vuetify',
  ],
  extends: [
    'standard',
    'plugin:vue/recommended',
    '@vue/typescript/recommended',
  ],
  parserOptions: {
    parser: '@typescript-eslint/parser',
  },
  rules: {
    // some rules omitted
    'vue/attributes-order': ['error', {
      order: [
        'DEFINITION',
        'LIST_RENDERING',
        'CONDITIONALS',
        'RENDER_MODIFIERS',
        'GLOBAL',
        'UNIQUE',
        'TWO_WAY_BINDING',
        'OTHER_DIRECTIVES',
        'OTHER_ATTR',
        'EVENTS',
        'CONTENT',
      ],
      alphabetical: true,
    }],
  },
};

What did you do?

<template>
  <div>
    <div
      class=""
      :class="{}"
    />
    <div
      :class="{}"
      class=""
    />
  </div>
</template>

What did you expect to happen?

lint --fix should set order in both divs either to :class class or class :class

What actually happened?

error: Attribute ":class" should go before "class" (vue/attributes-order) at src\App.vue:7:9:
   5 |       <div
   6 |         class=""
>  7 |         :class="{}"
     |         ^
   8 |       />
   9 |       <div
  10 |         :class="{}"


error: Attribute "class" should go before ":class" (vue/attributes-order) at src\App.vue:11:9:
   9 |       <div
  10 |         :class="{}"
> 11 |         class=""
     |         ^
  12 |       />
  13 |     </div>
  14 |
@ota-meshi
Copy link
Member

Thank you for this issue.

I will check and fix this bug.

@sense-it-gmbh
Copy link

Probably related to #1056

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants