Search code examples
vue.jseslintprettier

How to config eslint prettier disable style in Vue template files?


I want to ignore eslint all 'style' tags in .vue files. I have used @vue/prettier with eslint.

How to disable only 'style' tags in Vue template files?

.eslintrc.js

module.exports = {
  root: true,
  env: {
    browser: true,
    jquery: true,
    node: true
  },
  plugins: [
    "vue"
  ],
  extends: ["plugin:vue/essential", "@vue/prettier"],
  rules: {
    "prettier/prettier": "error",
    "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
    "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
    "new-cap": [
      2,
      {
        newIsCap: false,
        capIsNew: false
      }
    ],
    "no-useless-escape": 0
  },
  parserOptions: {
    parser: "babel-eslint",
    sourceType: "module"
  },
};

Solution

  • prettier and vue just don't mix. It has been a huge undertaking to figure this out. I use VSCode and man does it ruin my workflow. I had an issue with the ctlf feature that was indiscriminate in the way it determined which lines needed it.

    Try using Jon Gallants settings from here a link!

    It totally worked for me!