Crazy indentation conflict (eslint)

I was happily writing the code, but after the goose formatted, there was an eslint prompt error, saying that my indentation was wrong. After deleting the extra indentation, the formatting became the same as before! There is no problem elsewhere, so why would a small piece report an error? The project uses prettier for automatic formatting and eslint for error checking, but these two seem to have a feud and cannot get along. . . Not much nonsense, just go directly to the configuration code, find a way to find it for a long time, just adjust it according to the code, some items may not be useful, I hope it works for the officials.

// .eslintrc.js
module.exports = {
  root: true,
  env: {
    node: true,
  },
  'extends': [
    'plugin:vue/strongly-recommended'
  ],
  rules: {
    'indent': ['error', 2],
    'vue/script-indent': [
      'error',
      2,
      { 'baseIndent': 1 }
    ],
  },
  'overrides': [
    {
      'files': ['*.vue'],
      'rules': {
        'indent': 'off'
      }
    }
  ]
};

I commented out the project vue/script-indentif this will open other reported errors when using a self look.

reference

Guess you like

Origin www.cnblogs.com/teemwu/p/12739722.html