如何在Vue模板文件中配置eslint更漂亮的禁用样式?

时间:2020-01-29 05:16:48

标签: vue.js eslint prettier

我想忽略.vue文件中的所有'style'标签。 我在eslint中使用了@ vue / prettier。

如何仅禁用Vue模板文件中的“样式”标签?

.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"
  },
};

1 个答案:

答案 0 :(得分:1)

更漂亮,更不会混合。解决这一问题是一项艰巨的任务。我使用VSCode,但确实会破坏我的工作流程。 ctlf功能存在一个问题,该问题在确定哪些行需要它方面是不加区别的。

尝试从此处a link使用Jon Gallants设置!

这完全对我有用!