【发布时间】:2020-05-14 13:58:58
【问题描述】:
我想忽略 .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"
},
};
【问题讨论】:
-
请检查这篇文章是否有帮助:stackoverflow.com/questions/34764287/…
-
@monogate 这不适合我的情况......这种方式仅对特定文件或代码块或行有用。