Eslint-plugin-vue: Some rules are not fixable

Created on 5 Feb 2018  路  4Comments  路  Source: vuejs/eslint-plugin-vue

Tell us about your environment
OSX

  • ESLint Version:
    4.17.0
  • eslint-plugin-vue Version:
    4.0.0
  • Node Version:
    9.3
    Please show your full configuration:
// https://eslint.org/docs/user-guide/configuring

module.exports = {
  root: true,
  parserOptions: {
    parser: 'babel-eslint',
  },
  env: {
    browser: true,
  },
  // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
  // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
  extends: ['plugin:vue/strongly-recommended'],
  // required to lint *.vue files
  plugins: [
    'vue',
  ],
  // add your custom rules here
  rules: {
    // allow debugger during development
    "indent": [0, 2],
    "linebreak-style": ["error", "unix"],
    "quotes": [0, "single"],
    "semi": ["error", "never"],
    "brace-style": [2, "1tbs", {
      "allowSingleLine": true,
    }],
    "curly": [2, "all"],
    "no-console": ["error", {
      "allow": ["warn", "error", "log"],
    }],
    "no-unused-vars": 0,
    "no-empty": [0, "never"],
    "curly": 0,
    "comma-dangle": [2, "always-multiline"],
    "no-constant-condition": [2, {
      "checkLoops": false,
    }],
    "key-spacing": [
      0, {
        "multiLine": {
          "beforeColon": false,
          "afterColon": true,
        },
        "align": {
          "beforeColon": false,
          "afterColon": false,
          "on": "colon",
        },
      },
    ],
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  },
}

What did you do? Please include the actual source code causing the issue.
./node_modules/.bin/eslint --fix


What did you expect to happen?
fixed
What actually happened? Please include the actual, raw output from ESLint.

   9:53  error  Attribute "class" should be on a new line  vue/max-attributes-per-line
  30:50  error  Attribute "class" should be on a new line  vue/max-attributes-per-line
  51:55  error  Attribute "class" should be on a new line  vue/max-attributes-per-line
question

Most helpful comment

Thanks for clarifying, I hope that PR would be merged soon. It would be awesome to fix vue/max-attributes-per-line

All 4 comments

Yeah, not all rules are fixable.
If you want a rule to fix code automatically, please make a concrete proposal for each rule.

@mysticatea thanks for responding, do you know if those rules could be fixable in the future, or on a plan?

There is no plan. Changes will come based on issues since issues are consideration or requests on Vue community.

A volunteer works on vue/max-attributes-per-line (#380)

Thanks for clarifying, I hope that PR would be merged soon. It would be awesome to fix vue/max-attributes-per-line

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sqal picture sqal  路  3Comments

soullivaneuh picture soullivaneuh  路  3Comments

nirazul picture nirazul  路  3Comments

xiGUAwanOU picture xiGUAwanOU  路  3Comments

apertureless picture apertureless  路  4Comments