6

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"
  },
};
Kunie
  • 107
  • 2
  • 7
  • Please check if this post helps: https://stackoverflow.com/questions/34764287/turning-off-eslint-rule-for-a-specific-file/45762099 – monogate Jan 29 '20 at 08:05
  • @monogate That's not for my case... the way is useful only for specific file or code block or line. – Kunie Jan 29 '20 at 13:02

1 Answers1

-1

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!

Diggetydog
  • 56
  • 9
  • 2
    "you shouldn't do it" is not an answer to the question. I am using eslint with prettier so that I can have consistent linting and formatting across all different IDEs used in our teams. – klmdb Feb 02 '22 at 07:54